Commit Graph
4350 Commits
Author SHA1 Message Date
ldm0 bb234f5642 fix(window): enforce origin checks on canonical popup windows
Popup projections could disagree on identity and allow cross-origin access
to document, name, and arbitrary properties. Reuse each native popup Window
across opener and child projections and authorize property access against
the current caller origin.

Preserve initial Document navigation semantics and inherited domain state.
Carry popup ownership and origin through Promise continuations so old jobs
retain their origin after navigation and callers do not inherit popup access.
2026-11-20 22:47:42 +08:00
ldm0 960867bc41 fix(window): include root windows in named target lookup
Search receiver subtrees, page roots and familiar related contexts for named window.open, link and form targets using native names. Preserve native opener updates, including cached cross-origin accessors.

Inherit initial child origins from their popup owner so cross-origin popup frames do not become same-origin candidates. Cover duplicate names, sandbox entry authority, links/forms and cross-origin familiarity.
2026-11-20 22:47:42 +08:00
ldm0 3a36606c20 fix(window): check nested frame access from the current realm
Route child Window and contentDocument exposure through the existing realm access check. Cover initial nested frame access, cross-origin and opaque sandbox restrictions, and borrowed getters after document.domain changes.
2026-11-20 22:47:42 +08:00
ldm0 c3fa4d290a fix(window): resolve special open targets from the receiver
Use native parent/top relationships without consulting replaceable Window properties. Keep URL resolution and navigation authority tied to the entry Window, and preserve cross-origin WindowProxy projections.
2026-11-20 22:47:42 +08:00
ldm0 07cc74c6d7 fix(parser): register window handlers from merged body attributes 2026-11-20 22:47:42 +08:00
ldm0 f4bea35d7c fix(storage): deliver localStorage events across pages 2026-11-20 22:47:42 +08:00
ldm0 526c936c39 fix(window): resolve named iframe targets from the receiver 2026-11-20 22:47:42 +08:00
ldm0 24abeeae37 fix(navigation): prefer source frame in named target lookup 2026-11-20 22:47:42 +08:00
ldm0 a54e837bb6 fix(forms): preserve queued submissions before javascript URLs 2026-11-20 22:47:42 +08:00
ldm0 944a7d81c0 fix(forms): honor Get action URL submission rules 2026-11-20 22:47:42 +08:00
ldm0 d0701e4684 fix(navigation): enforce child javascript URL origin checks 2026-11-20 22:47:42 +08:00
ldm0 7d134fc7d8 fix(location): authorize popup access by native window origins
Bind Location access checks and borrowed methods to the owning LocalWindow origin, including domain changes and retained popup objects. Refresh Location on every popup document commit and keep native URL synchronization independent of checked public getters.

Cover nested origin layouts, child-owned popups, and navigation lifetimes. Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (20,091 passed, 16 skipped). Navigation and Location WPT comparisons show no regressions across 192 cases.
2026-11-20 22:47:42 +08:00
ldm0 cf212b886a fix(window): preserve popup roots for nested frames 2026-11-20 22:47:42 +08:00
ldm0 56ad08d335 fix(navigation): validate child ancestor navigation permissions 2026-11-20 22:47:42 +08:00
ldm0 df8de4a59a fix(navigation): complete popup document unload lifecycle 2026-11-20 22:47:42 +08:00
ldm0 1e71e557f8 fix(iframe): reject ancestor URLs during attribute navigation 2026-11-20 22:47:42 +08:00
ldm0 5cb52057ad fix(navigation): check child beforeunload before loading 2026-11-20 22:47:42 +08:00
ldm0 a606201fe6 fix(location): preserve entry settings during proxy forwarding 2026-11-20 22:47:42 +08:00
ldm0 564efe7012 fix(window): derive popup referrers from the entry document 2026-11-20 22:47:42 +08:00
ldm0 d993c27a02 fix(parser): adapt suspension paths to current ownership model
Reuse the claimed stylesheet pause in deferred preparation and use the shared source suspension cause for popup streams. Exercise document.write resume ownership with a body stylesheet boundary so nested inline execution cannot bypass the intended suspension.
2026-11-20 22:47:42 +08:00
ldm0 44e90412a4 test(workers): cover URL-like module specifier resolution 2026-11-20 22:47:42 +08:00
ldm0 59bc89b22f fix(workers): reject dynamic imports in service workers 2026-11-20 22:47:42 +08:00
ldm0 0486b9c192 fix(events): adapt retained receivers to shared dispatch
Update IndexedDB dispatch to the shared event preparation signature after
rebasing the upstream callback-lifetime changes. Keep destroyed-context
detection local to MessageChannel construction so retained constructors
still produce detached ports without allocating communication endpoints.

Exercise live parent listeners and retired child listeners on retained
EventTarget, MessagePort, FileReader and AbortSignal objects. Preserve
validation of event brands, dispatch state and exception realms.
2026-11-20 22:47:42 +08:00
ldm0 c7148cbf82 fix(dom): preserve document domains until document replacement
Keep the committed iframe Document's mutable origin while navigation
attributes are refreshed, including cancelled navigation and unload
callbacks. Reopening its input stream clears script state without resetting
document.domain; replacing the Document still resets it.

Cover explicit and implicit open, stop(), unload callbacks and microtasks,
and domain reset or inheritance at commit with a shared browser fixture.
The fixture passes all 81 checks in Chromium and the production Moli binary;
the previous Moli binary failed 30. Related WPT improves from 144 to 145
passing files out of 150, with three newly passing subtests and no regressions.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
-D warnings; full nextest 20,041 passed, 16 skipped; 190 focused tests passed.
2026-11-20 22:47:42 +08:00
ldm0 891d8c908c fix(dom): enforce original origins when opening document streams
Check the entry Document's original origin before document.open changes any
state, and apply the same check when write or writeln implicitly opens a stream.
Preserve inherited and retained origins, including DOMParser results and popup
Documents whose concrete realm belongs to the opener.

Cover relaxed domains, borrowed methods, exception realms, conversion order,
opaque origins, existing insertion points, and retained iframe/popup Documents.
2026-11-20 22:47:42 +08:00
ldm0 745ab10bd6 fix(parser): preserve insertion points in popup navigations 2026-11-20 22:47:42 +08:00
ldm0 5c32e2b191 fix(history): throttle excessive History API requests
Share a browsing-context budget across pushState, replaceState, go, back and
forward. Preserve argument conversion and mutation serialization/URL errors
before admission; refused calls do not cancel navigation or dispatch events.

Bound synchronous history update reentrancy across Windows and release the
admission guard on return. Retain child budgets across document navigation and
drop them when the browsing context is removed or closed. Cover recovery,
receiver ownership, conversion order, and recursive navigation callbacks.
2026-11-20 22:47:42 +08:00
ldm0 33a1457242 fix(navigation): reset focus within the navigating document
Rescan the owning Document for autofocus after intercepted navigation, with
focus-without-user-activation policy and native trusted initiation preserved
through transient activation expiry. Track focus changes per Document so a
parent focus change does not cancel a child navigation reset.

Keep viewport focus ownership explicit and retain the sequential Tab starting
point across manual focus resets and blur. Add regression coverage for policy,
autofocus selection, trusted input, Tab order, and nested viewport transitions.
2026-11-20 22:47:42 +08:00
ldm0 2c95c0ad61 fix(navigation): respect initiator origins across windows
Gate cross-document navigate events on the initiator and current target origin-domain while preserving cross-origin fragment events. Route named-frame window.open and GET form fragments through native Location navigation to preserve cancellation, interception, and document/history identity.
2026-11-20 22:47:42 +08:00
ldm0 159c070c80 fix(navigation): retain Navigation across initial Window reuse 2026-11-20 22:47:42 +08:00
ldm0 647abe1495 fix(navigation): preserve hyperlink navigate events
Route existing hyperlink targets through native Window identity and the shared
navigation path. Preserve click involvement and sourceElement, suppress
cross-origin source exposure, and honor cancellation and interception in child
frames and named popups.

Retain popup referrer policy and synchronous fragment activation after the
navigate event accepts it. Add regression coverage for trusted and synthetic
clicks, ancestor targets, canceled navigation, interception, and popup policy.
2026-11-20 22:47:42 +08:00
ldm0 f76d293bb0 fix(navigation): respect document origins during history traversal
Preserve each history entry's document origin across renderer seeds, including
inherited about: origins. Only dispatch traverse events for same-origin target
documents, using their origin before fetching or redirecting the destination.

Keep event eligibility separate from the contiguous Navigation entry list.
Hide destination identity and state outside that list and avoid creating
pending event state for suppressed cross-origin classic-history traversals.

Add HTTP regressions for child frames, popups, cross-origin gaps and srcdoc
inside cross-origin parents.
2026-11-20 22:47:42 +08:00
ldm0 9eae4f7495 fix(forms): schedule cancellable planned navigations
Keep submit and formdata events synchronous while navigation runs as a
DOM-manipulation task. Capture the request, submitter, target and history
handling; coalesce replaced submissions without extra task turns.

Preserve popup POST requests, cross-origin and sandbox boundaries, and
javascript URL replacement ordering. Follow form navigation that starts
during document creation and cover reentrant, adopted and same-URL forms.

Validation: cargo fmt --all; workspace all-target/all-feature clippy with
warnings denied; cargo nextest run --no-fail-fast (20,002 passed, 16 skipped).
Two additional official WPT cases pass with no passing-case regressions
across the form and Navigation API suites.
2026-11-20 22:47:42 +08:00
ldm0 5f1684d4ff fix(navigation): serialize reentrant history traversals 2026-11-20 22:47:42 +08:00
ldm0 05f257158e fix(navigation): expose native NavigationDestination bindings 2026-11-20 22:47:41 +08:00
ldm0 380f991690 fix(navigation): create transitions in their Navigation realm
Joint history traversal can create a sibling window transition while executing in the initiating realm. Enter the owning Navigation context before allocating the transition and its committed and finished promises.

Extend the shared browser regression to verify realm and entry/destination identity across successful, rejected, and stopped traversals.
2026-11-20 22:47:41 +08:00
ldm0 e0a887bae9 fix(history): order joint traversal callbacks before popstate
Finish currententrychange and all interception handlers before script cleanup, then dispatch popstate in its owning realm. Preserve committed history events when stop() cancels Navigation settlement.

Cover first-frame, last-frame, and top-level initiators with successful, rejected, and stopped interception in a browser-shared regression fixture.
2026-11-20 22:47:41 +08:00
ldm0 2ad03e28ad fix(history): integrate joint traversal plans with document lifecycles 2026-11-20 22:47:41 +08:00
ldm0 210c64e5a5 fix(fonts): validate FontFace descriptors with shared CSS parsing 2026-11-20 22:47:41 +08:00
ldm0 9f24336a3f fix(fonts): align FontFaceSet with native WebIDL bindings 2026-11-20 22:47:41 +08:00
ldm0 501abbbd73 fix(history): preserve queued and nested traversals with shared history
Keep JointSessionHistory as the history authority while retaining nested Document snapshots and exact traversal task owners. Coordinate all affected frames, preserve committed positions for queued deltas, and release traversal barriers on commit, cancellation, removal, or ignored responses. Republish browser history positions before a later renderer replacement.
2026-11-20 22:47:41 +08:00
ldm0 647cc7dde9 refactor(input): reuse shared editing primitives after rebase
Route clipboard and execCommand edits through the shared text-control input types and event construction. Verify native click preparation refreshes changed DOM/style geometry and reuses an unchanged snapshot.
2026-11-20 22:47:41 +08:00
ldm0 b36094c23e fix(fetch): adapt request validation to typed errors
Carry typed WebIDL failures through body validation and handle network request preparation errors at the binding boundary. Align the cross-realm invalid-URL regression with Chromium and the upstream conversion path.
2026-11-20 22:47:41 +08:00
ldm0 a7cb731aa2 feat(fonts): support FontFace loading in workers 2026-11-20 22:47:41 +08:00
ldm0 d9d85b497d fix(fonts): validate font set queries with Stylo 2026-11-20 22:47:41 +08:00
ldm0 6ef3d8b3b9 fix(fonts): validate binary FontFace sources
Decode and validate binary font data before marking a FontFace loaded, and
check SFNT table extents for every face in a collection. Reuse the stronger
validation for URL fonts so truncated unused tables cannot escape detection.

Reject shared and resizable sources during argument conversion, then copy
ordinary BufferSource bytes after descriptor conversion. Retain validated
bytes independently of later caller mutations and transfers.

Cover real TTF, WOFF and WOFF2 inputs, offset views, malformed and truncated
fonts, shared/resizable/detached buffers, descriptor side effects, collections,
URL font validation and cross-realm promises and errors.
2026-11-20 22:47:41 +08:00
ldm0 1ae6b469a1 fix(fonts): load URL-backed FontFace resources asynchronously
Fetch and validate font bytes through the owning Document resource loader,
including URL fallback, CORS, CSP redirects, Service Workers and preload/SRI
consumption. Preserve loaded promises and track pending FontFaceSet members,
ready promises and queued loading events.

Keep font tasks separate from author timer cancellation and dispatch child
CSP violations at their source Document. Replace fake font fixtures and
synchronous load assertions with real bytes and task-driven checks.
2026-11-20 22:47:41 +08:00
ldm0 148e687f46 fix(sri): preserve supported hashes with malformed padding
Keep supported hash metadata through verification so misplaced or excess
base64 padding cannot disable integrity checks or select a weaker algorithm.
Accept matching noncanonical base64 without changing encoded metadata used
by CSP and preload consumption.

Cover script, preload, CSP, and Window/Worker fetch consumers. Validate with
cargo fmt, workspace Clippy, and all 19,886 nextest tests, plus browser
comparisons and SRI/preload WPT regressions.
2026-11-20 22:47:41 +08:00
ldm0 09a5096546 fix(preload): consume stylesheet preload responses 2026-11-20 22:47:41 +08:00
ldm0 d5e2966cd8 fix(preload): consume document-owned preload responses 2026-11-20 22:47:41 +08:00