Commit Graph
4313 Commits
Author SHA1 Message Date
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
ldm0 fc35034823 fix(preload): verify ordinary preload integrity
Check ordinary preload responses with the shared SRI implementation, including CORS eligibility and Service Worker response filters. Dispatch error on verification failure while retaining the actual response bytes for Resource Timing.

Cover top-level and child parser links, dynamic links, binary bodies, redirect taint, hash selection, and Service Worker responses with integration regressions.
2026-11-20 22:47:41 +08:00
ldm0 f476c02036 fix(performance): distinguish cached and validated resource transfers
Carry Fetch response cache state through buffered and streaming responses,
navigation, child-document snapshots, and paused response continuations.
Fresh disk and memory hits are local; an actual 304 merge is validated.
A later memory-cache read resets validated state to local.

Resource Timing now reports zero transferred bytes for local hits, 300 for
validation, and body size plus the fixed 300-byte overhead for network
responses. Real response-header lengths no longer affect transferSize.

Exercise real HTTP cache hits, conditional requests, response bodies and
header padding in top and child documents. Preserve the existing network
provenance of in-flight script waiters.

Validation: cargo fmt --all; full workspace/all-targets/all-features Clippy
with -D warnings; cargo nextest run --no-fail-fast (19872 passed, 13 skipped).
All Cargo runs used 32 build jobs and 32 test threads. The production binary
matches Chromium across 22 cache-timing observations; preload controls stay
at 23/24 with the existing pending-preload duplicate-download failure.
2026-11-20 22:47:41 +08:00
ldm0 1fcb740b30 fix(preload): honor CORS settings for ordinary preloads 2026-11-20 22:47:41 +08:00
ldm0 cabaff9f62 fix(preload): discover ordinary preloads in child parsers
Route preload links from parser discovery through their child Document and reserved realm. Start admitted work while the parser is active, and discard pending work on Document or realm replacement.

Apply the child policy container and nonce-aware destination checks after preload type/media admission. Cover parser-blocking discovery, child CSP, cancellation, admission matrices, and the upstream cached-stylesheet preload regression.
2026-11-20 22:47:41 +08:00
ldm0 3e43b972b9 fix(preload): retain child document ownership for completions
Carry the originating Document through preload fetch completions and link
events. Create events in that Document's realm and record Resource Timing in
the request's Window instead of the parent. Keep historical network frame
identity when the Document is replaced, and retain the Window timeline across
document.open() without delivering retired link events.

Cover sibling frames, six preload destinations, cached stylesheet clients, and
gated completions across iframe navigation and document.open().

Retain resource timings that finish before the main world exists on the
native Window bootstrap, and publish them after its first main world is
registered.
2026-11-20 22:47:41 +08:00
ldm0 1624b37190 fix(preload): keep ordinary preloads from delaying window load
Use identity-only connected-link admission for ordinary preloads, including
CSP failures, so they cannot hold the Document load gate. Keep stylesheet
consumer leases and modulepreload fetch routing independent of that shared
non-blocking lifecycle.

Cover parser and dynamic preloads for six destinations with gated successful
and failed responses, proving Window load precedes completion while late
link events and resource timing remain observable. Preserve load blocking
for real stylesheet consumers and rel transitions.

Record two newly passing preload WPTs and verify modulepreload and MIME/as
controls. The pre-existing duplicate-fetch consumer case remains unchanged.
2026-11-20 22:47:41 +08:00
ldm0 43fa9fd8b4 fix(preload): honor MIME hints and media conditions
Reject unsupported MIME hints and nonmatching media before loading ordinary
preloads. Parse MIME parameters, use the owning Document viewport, and
reprocess media changes. Keep CSS preloads in the typed stylesheet path so
rejected hints cannot fall through to generic requests and abort the renderer.

Validation: cargo fmt --all; full workspace/all-features clippy with -D warnings;
full nextest (19,858 passed, 13 skipped) with 32 build jobs and test threads.
Two newly passing WPT files cover 46 subtests; 15 related WPTs and 476 preload
admission scenarios pass, including parser, dynamic and emulated-media paths.
2026-11-20 22:47:41 +08:00
ldm0 eb0c4c1e6c fix(wpt): integrate branch changes with updated main APIs
Complete the rebase adaptation to byte-preserving response headers across
XHR decoding, module loading, CORS, opaque bodies, cache responses and their
fixtures. Convert native headers to WebIDL ByteStrings at JS boundaries.

Align navigation settlement with the current optional resolvers and remove
duplicate reflection helpers, declarations and tests introduced by replaying
overlapping changes from main. Preserve both main and branch regressions.

Validation: cargo fmt --all; full workspace/all-targets/all-features clippy
with warnings denied; cargo nextest run --no-fail-fast (19,850 passed,
13 skipped). Build and test parallelism: 32.
2026-11-20 22:47:41 +08:00
ldm0 8a72b08c38 fix(window): preserve existing targets for empty open URLs
Keep an absent navigation URL through Window.open target selection. Reusing
a named iframe, popup, or special target must preserve the active document,
history state, and any pending navigation. Only a new browsing context
defaults to about:blank; explicit URLs still navigate normally.

Do not queue popup activation for an empty-URL reuse. Add regression tests
for loaded and pending named contexts, coercion to an empty URL, and child
scripts selecting _self, _parent, and _top.

Validation: cargo fmt --all; strict workspace Clippy; full nextest
(19,846 passed, 13 skipped), with 32 build jobs and 32 test threads.
Window.open defaults WPT now passes; no regression across the other
22 audited test pages or 10 popup control pages (95/95 subtests).
All 13 browser probes match Chromium.
2026-11-20 22:47:41 +08:00
ldm0 2d8fab4062 fix(events): preserve popup callback Window ownership
Retain each listener's captured Window identity for every event so opener
and sibling callbacks keep their timers and exception-reporting realm when
a popup closes. Continue retiring work owned by the closing popup.

Create existing popup test handlers inside actual popup documents and wait
for their ready messages; assigning opener callbacks to a popup must not
change their owner. Add pagehide and exception-routing regressions.

Validation: cargo fmt --all; strict workspace Clippy; cargo nextest run
--no-fail-fast (19,842 passed, 13 skipped), all with 32 build/test jobs.
Ten targeted WPT pages pass all 95 subtests; browser probes match Chromium.
2026-11-20 22:47:41 +08:00
ldm0 270a597600 feat(window): expose branded BarProp objects and popup visibility
Expose six lazy, distinct BarProp objects per Window with native receiver validation and replaceable Window attributes. Derive visibility from the owning live Window and the existing popup feature parser, including nested frames and window retirement.

Validation: cargo fmt --all; strict workspace Clippy; all 19,839 nextest tests passed (13 skipped), with 32 build jobs and test threads. Chromium comparison probes match. Targeted official WPT: 90/91 subtests pass; the remaining auxiliary-window timeout reproduces a pre-existing opener timer retirement bug independently of BarProp.
2026-11-20 22:47:41 +08:00
ldm0 de9e9919f6 fix(dom): end initial blank Window reuse after document.open
Clear initial about:blank after the current document.open replacement finishes
its URL/history update. Preserve the initial state on failed preflight and when
an outer completion has been superseded by a reentrant replacement.

Track Navigation entry initialization separately from initial blank state in
child documents and popups. Reconnect exposed same-origin WindowProxies when a
replacement commits, keeping Inspector registration and document-start scripts
in the queued realm turn.

Cover stream opening, implicit writes, reentrancy, retained Window references,
and Navigation history state. Bind the old Navigator in the stale Beacon test
and advance earlier Page lifecycle tasks before BroadcastChannel delivery.

Validation: cargo fmt --all; strict workspace/all-target/all-feature clippy;
19,836 nextest tests passed, 13 skipped, at 32 build/test workers. The target
initial-blankness WPT now passes 2/2; related automated WPT pages have no
regressions. Chromium comparisons cover Navigation, getters and message channels.
2026-11-20 22:47:41 +08:00
ldm0 377732a042 fix(dom): initialize document modes and blank popup URLs
Reset child documents to no-quirks before opening a parser, while allowing
completed doctype tokens or EOF to select the subsequent document mode.

Create initial and navigated blank popup documents without a doctype, and
synchronize the committed Location before binding the replacement Document.
Cover chunked input, native no-quirks state, opener isolation, and blank
popup navigation.

Validation: cargo fmt --all; workspace all-target/all-feature Clippy with
-D warnings; 19,832 nextest tests passed, 13 skipped (32 jobs and threads).
Eight Chromium behavior probes match; 24 official WPT pages have no
regressions and three additional document.open subtests pass.
2026-11-20 22:47:41 +08:00
ldm0 f30e5c8b42 fix(dom): abort child loads when opening a document stream
Cancel an ongoing child navigation before document.open replaces its stream,
and abort requests owned by that Document. Queue Fetch rejection and XHR
abort delivery in the preserved Window, while guarding reopened XHRs and
leaving ordinary document.open requests intact.

Retain the active-parser-aborted flag on the Document so later open/write
calls remain ineffective after navigation or window.stop aborts its parser.
New Documents created by cloneNode start with that flag cleared.
2026-11-20 22:47:41 +08:00
ldm0 bc0448f5d4 fix(dom): parse popup document streams incrementally
Keep a live parser session for popup document.open/write/close, sharing
DOM mutation and element construction with the child-document parser.
Preserve split tokens, node identity and parser-script insertion order;
resume external scripts and drain deferred work before completion.

Cancel stale parser and lifecycle work when a stream is replaced, and
mark prepared scripts started before CSP filtering. Cover tree reset,
script scheduling, custom-element reentry and blocked-script adoption.
2026-11-20 22:47:41 +08:00
ldm0 f4e1dd7103 fix(dom): erase popup event listeners when opening document streams
Clear the popup Document and its shadow-including tree through the shared
native callback retirement path before stream replacement mutates the DOM.
Clear only that popup Window's listener and handler state, including pending
content handlers, without calling page-defined accessors.

Cover borrowed methods, detached/template nodes, Window isolation, reentrant
dispatch, implicit write boundaries, conversion failures and content handlers.

Validation (32 build jobs / test threads): cargo fmt --all; workspace clippy
with all targets/features and -D warnings; full nextest (19,813 passed,
13 skipped); seven Chromium differential probes and four WPT pages.
2026-11-20 22:47:41 +08:00
ldm0 cbef7f209c fix(dom): update popup document stream URLs from the entry document
Popup document.open and opener-initiated writes kept the popup's previous URL
instead of applying the entry document's URL/history update. Sync the native
Document, Window history, base URL and future request context while preserving
Document identity, history.state and the existing resource authority/origin.

Use implicit open for the first write regardless of which popup owns the
calling code. Publish native URL state before history callbacks and clear the
initial about:blank flag after the update. A queued close does not retire the
current Document until its close task runs.

Cover borrowed and implicit opens, source fragments, opener base isolation,
request context snapshots, reentrant history changes and queued closure.
2026-11-20 22:47:41 +08:00
ldm0 9282058c6f fix(dom): route popup document streams through shared bindings
Popup Documents installed their own open/write/writeln/close methods, bypassing
Document receiver checks, XML preconditions, and Trusted Types conversion.
Borrowing Document.prototype methods could instead enter the main document's
replacement path and clear the opener.

Inherit the existing Document bindings and route operations by the receiver's
current popup owner. Select its Window policy even when the wrapper shares the
opener's V8 realm, and convert write arguments before mutating content.

Snapshot delivered meta CSP when window.open or a hyperlink creates a popup,
and seed inherited policies before importing its markup. This keeps receiver
policy checks independent of later opener changes without losing inherited
requirements or the popup's own meta policies.

Cover native receiver checks, XML receivers, borrowed methods, opener ownership,
Trusted Types isolation and inheritance, and load callback conversion ordering.
2026-11-20 22:47:41 +08:00
ldm0 066b763108 test(popup): cover body and frameset content handlers 2026-11-20 22:47:41 +08:00
ldm0 b8abf8e71c fix(popup): share body and frameset Window handler properties
Route body/frameset IDL attributes through their owning popup Window's existing handler values and ordered registrations. Include onmessageerror in the shared Window handler list and clear private handler state on document retirement without invoking author-replaced setters.

Cover shared values, listener replacement and cancellation, onerror arguments, adoption, windowless ownership, and document retirement.
2026-11-20 22:47:41 +08:00
ldm0 a926611fd0 fix(popup): drive parsed document readiness and DOMContentLoaded
Keep network and javascript-URL popup documents loading while their classic
scripts run. Resume parser completion after the producing task's script
reactions, then dispatch DOMContentLoaded and load in separate DOM tasks.

Keep child-frame load blockers distinct from parser completion and validate
the concrete Window before each readiness/load continuation. Cover trusted
Document events, popup Window bubbling, script reactions, external-resource
gates, and close/replacement during lifecycle callbacks.
2026-11-20 22:47:41 +08:00
ldm0 fc6a95d2b6 fix(popup): keep DOM event propagation in the owning Window 2026-11-20 22:47:41 +08:00
ldm0 38d45c91c1 fix(popup): dispatch native lifecycle events with Document targets
Construct popup load events through the intrinsic Event constructor and apply the legacy Document target override to load and pageshow. Keep dispatch paths and listener receivers on the popup Window.

Cover native interfaces, trust, cancellation, cleanup, redispatch, constructor overrides, retirement during load, and failed initial navigation without a materialized Document.
2026-11-20 22:47:41 +08:00
ldm0 82ae5c33ef test(protocol): await restored documents and focus events 2026-11-20 22:47:40 +08:00
ldm0 fcc58e7c5b fix(clipboard): adapt native actions to shared snapshots 2026-11-20 22:47:40 +08:00
ldm0 85b807b311 fix(history): remove stale admission import after rebase 2026-11-20 22:47:40 +08:00
ldm0 64b3c37654 test(renderer): deduplicate upstream CSP and CSS regressions
Keep a single copy of the identical CSP base64url and CSS alt-counter regressions already present upstream.
2026-11-20 22:47:40 +08:00
ldm0 748b347fd2 fix(svg): reconcile element bindings with upstream owner semantics
Keep one branded SVGElement declaration with both className and ownerSVGElement. Retain the upstream owner lookup and its broader regression coverage while removing the duplicate declaration, callback, and older test.
2026-11-20 22:47:40 +08:00
ldm0 674e90580c test(history): adapt navigation fixtures after main rebase
Initialize the history field in the upstream navigation fixture. Use the existing 8 MiB stack helper for the two deep traversal tests whose replacement-navigation path exceeds the default test-thread stack.
2026-11-20 22:47:40 +08:00
ldm0 b325d6f12c fix(fetch): adapt WPT paths to native header and response types
Use the upstream native header and async response types in the branch-specific Fetch, XHR, worker, and service-worker paths. Keep local URL ByteString boundaries and route parkable images through the shared CORS redirect checks.
2026-11-20 22:47:40 +08:00
ldm0 33370d8adc fix(history): restore nested histories across document replacement
Keep child entries and srcdoc resources with their parent Document identity
when top-level and popup Documents are replaced. Restore their original joint
history steps, avoid traversing descendants of a retiring parent, and prune
forward entries when navigation branches from an earlier step.

Preserve parser-created frame identities in navigation projections. Cover
named and unnamed frames, script-created parents, nested Documents, entry
state and identity, and interleaved multi-step traversals through CDP.
2026-11-20 22:47:40 +08:00
ldm0 70d3b80574 fix(history): restore historical srcdoc documents
Retain srcdoc resources by history Document identity, including the original source, base URL, policy and origin. Restore each entry URL separately and apply the current iframe sandbox flags when reconstructing the Document.

Cover top-level and popup child traversal, classic and Navigation API state, and sandbox script/origin changes.
2026-11-20 22:47:40 +08:00
ldm0 7a41c7517a fix(history): commit iframe attribute navigations consistently
Plan src and srcdoc push/replace operations from the committed document,
its load state, and the initiator origin. Publish local attribute commits
to joint session history without exposing pending entries synchronously.

Preserve same-origin srcdoc replacement keys and route live popup iframe
setAttribute calls through the shared src navigation path. Cover load
phases, coalesced srcdoc writes, fragment transitions, and popup ownership.

Keep initial attribute commits lazy when there is no joint history
mutation, preserving the scheduled child realm and lifecycle boundaries.
2026-11-20 22:47:40 +08:00
ldm0 d12d2c0d2e fix(popup): preserve iframe history and native load delivery
Collect joint-history children from the owning root document so popup iframe
navigations contribute to their own history without pruning opener entries.
Keep root commits valid before the new native Document handle is installed.

Use the existing detached-content predicate when synthesizing iframe load
events, leaving live popup and child-document frames to the native lifecycle.
Cover same-document history forks and cross-document popup traversals while
checking that the opener history is unchanged.
2026-11-20 22:47:40 +08:00
ldm0 402de4c99b fix(navigation): let renderer requests supersede pending loads
Allow top-level navigation owner actions from the current Document through
the in-flight navigation gate so they can cancel the previous request.
Keep exact scheduler predecessors and Page residence validation in place.

Cover an unresponsive first request replaced by page JavaScript without
further client commands, and ensure only the replacement enters history.
2026-11-20 22:47:40 +08:00
ldm0 f77ed79182 fix(history): restore top-level navigation snapshots
Carry committed renderer history through browser navigation requests and
restore structured state, entry identities, and activation before new
Document scripts execute. Read the latest committed source entries when
creating the destination so state updates made during a pending response
are retained.

Keep browser traversals aligned with native Document identities, rebuild
private history ordinals for restored top-level entries, and use native
entry indices for fragment mutations after a cross-origin history prefix.

Cover structured-state restoration, pending-navigation source updates,
fragment indices, browser-owned back/forward traversal, and same-Document
realm and element preservation after WebDriver history restoration.
2026-11-20 22:47:40 +08:00
ldm0 6963e04a89 fix(history): preserve structured state in navigation snapshots 2026-11-20 22:47:40 +08:00