Commit Graph
2825 Commits
Author SHA1 Message Date
lanyue-llk 164e8aaec9 fix(renderer): omit empty hidden structures and synthetic control defaults 2026-11-03 17:07:17 +08:00
lanyue-llk 0353303786 fix(fetch): retain document structure across live visibility states 2026-11-03 17:07:17 +08:00
lanyue-llk e357277aad fix(fetch): retain nested disclosures and computed text boundaries 2026-11-03 17:07:17 +08:00
lanyue-llk 79dd8e439b test(fetch): distinguish computed layout from source-only table snapshots 2026-11-03 17:07:17 +08:00
lanyue-llk 919029e577 fix(renderer): preserve source and disclosure boundaries in one style pass 2026-11-03 17:07:17 +08:00
lanyue-llk 80e0bffbe0 fix(markdown): retain default text for unedited textarea controls 2026-11-03 17:07:17 +08:00
lanyue-llk 6b70341184 fix(markdown): read live textarea values through the DOM adapter 2026-11-03 17:07:17 +08:00
lanyue-llk fad2219f9b fix(renderer): export live rendered content through shared markdown conversion 2026-11-03 17:07:17 +08:00
ldm0 cd2744c59e fix(benchmark): recognize Chromium error document completion
Chromium reports loadingFailed for a failed document request and later
loadingFinished when its internal error Document commits and loads under
the same request identity. The sequential navigation audit incorrectly
reported duplicate terminals and a successful terminal without a response.

Recognize this pair only when a same-session chrome-error frame commit
matches the request's frame, loader, and final unreachable URL between
the failure and completion. Keep ordinary request ordering and duplicate
terminal checks, and retain the transport failure in request summaries.

Cover direct and redirected failures, identity mismatches, missing or
misordered commits, extra terminals, and preservation of failure details.
2026-11-03 16:22:10 +08:00
ldm0 2db52b45ba fix(svg): resolve inherited relative font weights correctly v1.1.21 2026-11-03 11:55:43 +08:00
wslee 46f7e37989 test(svg): cover inherited italic and condensed faces 2026-11-03 11:55:43 +08:00
wslee f2813e4a9f fix(svg): preserve inherited fonts and resolve missing families 2026-11-03 11:55:43 +08:00
ldm0 b2a45e6129 fix(webdriver): unify Classic and BiDi node references 2026-11-03 11:04:27 +08:00
ldm0 ea1076e2db fix(cdp): preserve per-page output fences during Fetch teardown
Fix MOL-554 by keeping renderer output fences for different Pages as
independent predecessors of the existing protocol output work item.
Preserve command correlation when publishing cleanup and detach events
after every original renderer prefix has crossed protocol ingress.

Cover continued and outstanding Fetch requests across two Pages, and prove
that projecting one Page's cursor cannot release another Page's output.

Validation: cargo fmt --all; workspace all-target/all-feature Clippy;
Nextest 21,987 passed, 19 skipped; Playwright reproduction passes 3/3.
2026-11-03 10:48:27 +08:00
ldm0 6043f02345 fix(cdp): resume queued evaluations after history navigation 2026-11-03 10:46:29 +08:00
ldm0 24ad52ddd2 fix(webdriver): preserve node scope across Classic and BiDi 2026-11-03 09:09:03 +08:00
ldm0 52159a6a68 chore(release): update version to 1.1.21 2026-11-03 08:37:41 +08:00
ldm0 69bbcc237d fix(stylesheets): reject child integrity failures before CSSOM installation
Check SRI admission in the child stylesheet installer before preparing an
owner CSSStyleSheet. The later resource-result guard runs after installation
and otherwise leaves an empty sheet visible for rejected responses.

Keep error completion and load-delay release on the existing terminal path.
2026-11-03 08:33:33 +08:00
Neo 孫 aba4dd5641 test(renderer): keep backend node IDs unique across Documents
The process-wide allocator is already present on main. Exercise the shared
registry constructor with separate Documents that reuse a local DOM handle,
and verify exported IDs remain unique and cannot resolve in the other registry.
2026-11-03 08:33:33 +08:00
ldm0 13067101ce fix(stylesheets): limit child request sharing to in-flight loads
Remove completed responses from the frame stylesheet store. Later link and
inline import owners now enter Fetch again, so the existing cache decides
whether to reuse, revalidate or download a response, and failures can retry.

Use each request's load-delay token to match its completion before taking
the remaining subscribers. A duplicate completion cannot settle a later
request for the same signature, and revoked owners stay excluded.

Cover no-store, fresh max-age responses and network failure recovery for
both links and imports, including the parser's wait for each new completion.
2026-11-03 07:53:58 +08:00
ldm0 53533d3e99 fix(stylesheets): revoke stale child load subscriptions 2026-11-03 07:53:58 +08:00
ldm0 0f795df8ed fix(stylesheets): replay completed child loads for late owners 2026-11-03 07:53:58 +08:00
ldm0 8597efb12f fix(stylesheets): bind parser imports before releasing scripts 2026-11-03 07:53:58 +08:00
ldm0 eac226d361 fix(stylesheets): evaluate parser media in the owning document 2026-11-03 07:53:58 +08:00
ldm0 d7d045a45a refactor(css): share native Stylo media query evaluation 2026-11-03 07:53:58 +08:00
ldm0 3c8e9c64be test(fetch): eliminate port reservation races in connection failures 2026-11-03 07:53:58 +08:00
Johannes Pfeiffer 003c7a33b4 test: make connection and Unicode-range fixtures portable 2026-11-03 07:53:58 +08:00
Johannes Pfeiffer 3a785d5815 fix(stylesheets): recognize unconditional screen media lists 2026-11-03 07:53:58 +08:00
ldm0 b593f7e617 fix(webdriver): restore Classic opt-out and BiDi client workflows 2026-11-03 07:23:02 +08:00
ldm0 feb019b3c6 fix(fetch): enforce CORP before redirect and response delivery
fix(fetch): enforce CORP before redirect and response delivery.

Extracted from development commit db59e77d3c5 and adapted to main.

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 132.611s] 22172 tests run: 22172 passed (9 slow), 20 skipped
2026-11-03 07:18:55 +08:00
ldm0 86ede9afdb fix(stylesheets): reject child integrity failures before CSSOM
Reject integrity-failed parser stylesheet responses in child Documents before preparing or installing an owner CSSStyleSheet. Complete the failed load and release its blocker through the existing terminal path.

Add eight end-to-end URL iframe/srcdoc cases covering initial and cached integrity rejection, matching hashes, CSSOM and computed style, dependent import suppression, and parser/DCL/iframe-load progress.

The regression reproduced the empty-sheet bug at the previous PR head. Validation at 32 build jobs, test threads and Tokio workers: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
Summary [ 146.212s] 22163 tests run: 22163 passed (9 slow), 20 skipped
2026-11-03 07:16:23 +08:00
ldm0 85049ac2cf fix(stylesheets): validate integrity before installing CSSOM 2026-11-03 07:16:23 +08:00
ldm0 191e5fc166 refactor(protocol): make context preload IDs authoritative
Store DevToolsPreloadScriptId in BrowserContext preload registrations and keep registry_key unset there. Preserve typed IDs through registration, routing, removal and response projection.

Derive renderer keys through a shared descriptor projection for navigation and live updates, and derive removal keys from the same protocol ID. Extend the regression to verify that a previous renderer key cannot become a second stored identity.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (22,197 passed, 20 skipped).
2026-11-03 07:13:38 +08:00
ldm0 e5c74d4643 refactor(protocol): clarify context preload naming
Name mutable BrowserContext registrations context_preload_scripts and name the startup-plus-protocol projection context_document_start_script_descriptors. Update registration, removal, channel lookup and pending command names to match their ownership.

Keep startup scripts separate and preserve script IDs, renderer registry keys, diagnostic fields and execution order.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (22,197 passed, 20 skipped).
2026-11-03 07:13:38 +08:00
ldm0 de4cc98f47 fix(serve): preserve startup scripts across protocol lifecycles
Capture startup scripts before creating navigation engines and install them when each BrowserContext is created. Keep CLI scripts outside mutable protocol preload registries so engine resets and protocol removals preserve startup policy.

Pass complete runtime configuration through BiDi and Classic entry points. Add six regression tests covering protocol navigation, iframes, late contexts, new windows, preload removal and engine reset.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (22,197 passed, 20 skipped).
2026-11-03 07:13:38 +08:00
Neo 孫 686d9d6c57 fix(serve): honor --document-start-script in protocol-server pages
`moli fetch` reads configured document-start scripts straight from
BrowserConfig, but `moli serve` builds its pages from
NavigationRuntimeConfig, which never carried them, so the flag was a
silent no-op in serve mode.

- NavigationRuntimeConfig gains `document_start_scripts`, populated in
  From<&BrowserConfig>; the two exhaustive destructurings mark it as not
  engine state.
- BrowserContextState::bind_page_navigation_engines seeds each configured
  script into the context's default document-start registry (the same
  registry BiDi addPreloadScript uses), once per context.

Verified: unit test for the config hop; end to end, a script that
increments a counter reads 1 after each of two navigations (upstream
binary: script never runs).
2026-11-03 07:13:38 +08:00
ldm0 d9290e87ad feat(modules): support native text module imports
Support type: text through the shared module map, Window, child Documents and workers. Export UTF-8 decoded strings without executing their contents, preserve typed-module identity, and carry text request metadata through network, preload and Service Worker loaders. Regressions cover static/dynamic import sharing, BOM and invalid UTF-8, CORS, integrity, worker environments and unsupported-type rejection.

Extracted from development commit a6de018613.
Base: main (62e527cd34).

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 146.817s] 22203 tests run: 22203 passed (9 slow), 20 skipped
2026-11-03 06:30:06 +08:00
Neo 孫 7ab8319998 fix(system-info): accept the frontend's browser session (SystemInfo always rejected over real connections)
The frontend router dispatches every command with a session: the client's
sessionId, or the frontend's own browser session when the client sent none.
SystemInfo.getInfo / getProcessInfo rejected any command with a session, so
over a real browser-endpoint connection they always answered "only supported
on the browser target" (unit tests passed because TestContext sends no
session). Measured: a fresh, never-attached browser-endpoint connection got
the error too.

Use the same rule as Target's browser-only operations: no session, or a
session whose route is the browser (`is_browser_session_id`). Page / frame
target sessions are still rejected (the existing two tests are unchanged).

Test: system_info_accepts_the_frontend_browser_session. Reverting the check
fails it. fmt / clippy -D warnings clean.
2026-11-03 06:13:21 +08:00
ldm0andneosun100 c94a52ffa7 fix(smoke): keep external endpoint discovery independent of local browsers
Limit protocol discovery checks to the selected endpoint. Run endpoint
identity comparisons and restart checks from the managed target-lifecycle
group, while preserving discovery, stability and invalid-path checks for
external endpoints.

Cover external protocol workers and managed-process restart behavior.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0andneosun100 ac3bcc8db7 fix(fetch): apply request header guards before merging extra headers
Filter author-provided headers in Window and Worker fetch inputs for both
URL and Request override paths, using the guard selected by request mode.
Keep trusted extra HTTP headers separate from this filtering.

Add network coverage for header handling across fetch modes and input
forms, including Window/Worker behavior and trusted-header compatibility.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0andneosun100 33ba7e5c46 test(server): reproduce cross-origin page takeover attempts
Load an attacker page in Moli and exercise browser CDP, page CDP and BiDi
WebSockets against the built binary. Verify that default cross-origin
connections fail while native clients continue to work.

Include same-origin, explicit allowlist and wildcard positive controls,
and verify that rebinding Host requests remain blocked. Support Chromium
as an optional attacker-page engine.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0andneosun100 b6116eb8b8 fix(server): validate protocol Host and Origin before routing
Apply a shared guard before HTTP and WebSocket routing across CDP,
WebDriver Classic and BiDi. Accept any IP literal, or localhost and its
subdomains (including a trailing root dot). Treat an empty port as
unspecified.

Allow requests without Origin, from the bound server's HTTP origin, or
from explicitly allowlisted origins. Support repeated and comma-separated
--remote-allow-origins values and the '*' wildcard. Reject ambiguous
headers and keep Host validation independent of Origin exceptions.

Cover the HTTP routers, CDP and BiDi WebSocket handshakes, and WebDriver
text/plain session creation, including same-origin compatibility.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0andneosun100 08e83bffc0 fix(cdp): randomize browser endpoints and page target identities
Generate a fresh browser WebSocket UUID per server and random 128-bit page
and tab target IDs for network CDP owners. Keep discovery URLs and protocol
target IDs consistent, and make clients discover endpoints instead of
relying on fixed paths.

Cover endpoint rotation, guessed and foreign ID rejection, and target
lifecycle behavior.

Co-authored-by: neosun100 <neosun100@users.noreply.github.com>
2026-11-03 05:53:28 +08:00
ldm0 8d536e4ca6 perf(dom): skip frame projection when no child contexts exist
perf(dom): skip frame projection when no child contexts exist.

Extracted from development commit aeccb884443 and adapted to main.

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 142.740s] 22165 tests run: 22165 passed (9 slow), 20 skipped
2026-11-02 23:29:58 +08:00
ldm0 62e527cd34 fix(dom): distinguish declarative shadow roots from template contents
Determine whether a fragment is template contents from its actual native host instead of scanning parser template aliases. Preserve custom-element upgrades in declarative ShadowRoots and cover innerHTML, setHTMLUnsafe, cloning, import and adoption.
2026-11-02 23:28:55 +08:00
ldm0 ec83aaab72 fix(dom): restore copied document URL after cloned base removal
fix(dom): restore copied document URL after cloned base removal.

Extracted from development commit 77ef817c7e8 and adapted to main.

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 140.724s] 22165 tests run: 22165 passed (9 slow), 20 skipped
2026-11-02 23:28:02 +08:00
ldm0 36af8cb57a fix(cdp): publish timer output while document loading remains pending
Only attach the source Document post-load fence when Load was already reached when selecting the timer. Publish timer notifications from open HTML streams promptly and retain the captured source snapshot when callbacks replace their Document.
2026-11-02 23:26:23 +08:00
ldm0 51d6d1ee3e fix(events): derive nullable CSS animation event associations
Expose the nullable readonly animation member on AnimationEvent and TransitionEvent using derived CSSAnimation/CSSTransition interface conversion and native payload snapshots. Preserve inherited/member getter order, exact native object identity, callee-realm errors and early rejection of author proxies or forged brands. Verified against the CSS Animations 2 and CSS Transitions 2 IDL definitions.

Extracted from development commit bf86d34d5ae17e2830c77648ceda25ec4a03c690.
Base: main (b30f39c580).

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 147.256s] 22170 tests run: 22170 passed (9 slow), 20 skipped
2026-11-02 22:31:04 +08:00
ldm0 7e8b925824 test(indexeddb): cover queued transaction and wrapper collection
Verify active and queued SQLite transactions remain reachable until their SQL completion, then release their native wrapper records after GC. Retained finished transactions and detached objectStoreNames snapshots must preserve visible state while discarded transactions return native registry counts to zero.

Extracted from development commit f3fe5e2269cad98395c679d466f97209199a1151.
Base: main (b30f39c580).

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 148.138s] 22171 tests run: 22171 passed (9 slow), 20 skipped
2026-11-02 22:30:05 +08:00
ldm0 f1f202ca25 test(indexeddb): cover retained pending upgrades after realm retirement
Retain a pending upgrade transaction from an isolated realm, retire that realm and verify the transaction retains its native identity only while JavaScript holds it. Force GC after releasing the last external reference to detect native roots of retired upgrade request/database handles.

Extracted from development commit 7698196f39.
Base: main (b30f39c580).

Validation (32 build jobs and test threads): cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
     Summary [ 148.190s] 22170 tests run: 22170 passed (9 slow), 20 skipped
2026-11-02 22:29:44 +08:00