Commit Graph
4451 Commits
Author SHA1 Message Date
ldm0 0fec98e0aa fix(css): preserve Typed OM numeric serialization semantics 2026-11-22 02:01:56 +08:00
ldm0 f88a05f6e3 feat(css): parse native Typed OM style values 2026-11-22 02:01:56 +08:00
ldm0 9af536952c feat(css): add native unparsed Typed OM values 2026-11-22 02:01:56 +08:00
ldm0 785ccd7520 feat(svg): expose remaining filter primitive interfaces 2026-11-22 02:01:56 +08:00
ldm0 55c0c72ad8 fix(svg): synchronize retained animated attribute values 2026-11-22 02:01:56 +08:00
ldm0 96fa529514 fix(dom): preserve UTF-16 attribute values 2026-11-22 02:01:56 +08:00
ldm0 29952e5233 fix(build): deduplicate declarations and tests after main rebase 2026-11-22 02:01:56 +08:00
ldm0 b997cd76c8 fix(events): expose selection and gamepad handlers
Use the shared handler bindings for Window, DOM elements and body/frameset forwarding. Preserve MathMLElement identity in windowless documents so their global event handlers stay available.
2026-11-22 02:01:56 +08:00
ldm0 c4b38ba09e fix(build): deduplicate declarations after main rebase
Main and the WPT branch independently introduced the MathML namespace
constant and three identical regression tests. Retain one copy of each
so the rebased test modules compile without duplicate definitions.

The removed test bodies were compared byte for byte against the retained
copies. Preserve the additional upstream tests for Selection, SVGPoint,
and directionality.
2026-11-22 02:01:56 +08:00
ldm0 92e9ad3809 fix(worker): inherit local script referrer policies
Resolve local worker policy from the Blob URL creator environment, including
meta updates delivered before startup. Keep existing worker snapshots and
SharedWorker reuse stable, and carry the policy through worker-created URLs.
Preserve parent request and child response policy for nested HTTP workers.

Validate with the complete fmt, clippy, and nextest gates (20,458 passed),
73 original WPT files (665 -> 667 passed, zero regressions), and 226 network
comparisons covering worker types, ownership, policy timing, and overrides.
2026-11-22 02:01:56 +08:00
ldm0 044dc8be91 fix(css): preserve referrer state across stylesheet imports 2026-11-22 02:01:56 +08:00
ldm0 61dea24d80 fix(css): snapshot document referrer policy for stylesheet requests
Capture the owning Document policy at stylesheet resource admission and
include it in the shared resource key, while preserving existing owner
bindings. Carry parser/preload snapshots and child Document policies into
the native request.

Test policy changes, shared URLs, parent/child isolation and parser-created
stylesheets through the controlling service worker. The shared browser
fixture performs 55 comparisons and also passes in Chromium.
2026-11-22 02:01:56 +08:00
ldm0 bf28068319 fix(fetch): resolve client referrers before dispatch
Select the live Document URL, following srcdoc containers and rejecting opaque
client origins, before applying the effective referrer policy. Resolve these
values before both service-worker interception and native network dispatch,
without changing the public Request or the origin and cookie initiator.

Use HTML's about:srcdoc URL match so javascript replacements remain srcdoc
Documents. Preserve the replaced Document's current delivered policies,
including removed meta elements, instead of reverting to response-only state.

Cover network headers across two origins, author base URLs, history changes,
about:blank boundaries, javascript replacements, opaque srcdoc Documents, and
service-worker request metadata.

Keep Fetch resource classification when attaching policy metadata, and isolate
memory-cache entries by their resolved Referer so policy changes cannot reuse
a response selected for a different referrer.
2026-11-22 02:01:56 +08:00
ldm0 f7a3dbb53a fix(fetch): separate Request base URLs from settings origins
Validate RequestInit.referrer against the origin retained by its actual realm,
including retired child realms and popup aliases. An inherited or authored
base URL must not authorize a foreign referrer or discard a same-origin one.

Resolve main-document relative Request URLs against the live document base.
Cover same-origin, foreign, relative, empty, and client referrers in main and
child realms, plus retained constructors after iframe removal.
2026-11-22 02:01:56 +08:00
ldm0 40d5d4b404 fix(referrer): snapshot creator policy for local documents
Capture the creator Document's current effective referrer policy when cloning
its policy container. Initial empty child documents now resolve their actual
owner, including popup parents, and reuse the shared inheritance path.

Preserve the original navigation policy when recording about-document history
state. Test creation snapshots, later parent and child mutations, removed meta
elements, grandchildren, and explicit Fetch overrides across both origins.
2026-11-22 02:01:56 +08:00
ldm0 829b5c2d8f fix(referrer): persist meta policy on each document
Apply meta referrer delivery on insertion and attribute changes, preserve it across removal and document.open(), and share the state with Fetch, XHR, and existing script consumers. Cover temporal ordering, namespaces, windowless documents, cloning, and main/child/popup network owners.
2026-11-22 02:01:56 +08:00
ldm0 8f82c0e235 fix(scripts): honor document referrer policies for classic fetches
Capture the owning Document policy when preparing parser and runtime script
requests, separately from persistent script fetch options. Preserve the HTML
preload scanner snapshot and pass it to classic script and link preload fetches.

Admit child preload links at their parser token boundary and retain the policy
while waiting for realm creation, so a later meta cannot change an earlier
request. Keep explicit attributes and subsequent dynamic imports independent.

Cover main and child Documents, parser and runtime modes, same/cross origins,
header and meta defaults, invalid/explicit attributes, and delayed realm creation
with real HTTP regressions that also check request and execution counts.
2026-11-22 02:01:56 +08:00
ldm0 88d6b38176 fix(runtime): pin owner task futures before executor handoff
Larger script preparation state exposed a stack overflow while a child message
handler created an external worker. LLDB stopped in spawn_local while reserving
another large copy of the owner task future on the caller stack.

Pin the payload before wrapping it in executor/TLS and spawn futures so nested
owner turns carry a pointer instead of duplicating the task state.
2026-11-22 02:01:56 +08:00
ldm0 121316c3ea fix(fetch): accept close-delimited HTTPS responses
Enable the opt-in curl TLS EOF behavior from a8c770e while retaining
certificate verification, TLS record errors and HTTP framing checks.
The fork also rejects incomplete HTTPS response headers so accepting
transport EOF does not expose truncated header sections as responses.

Cover real TLS connections with and without close_notify, HTTP/1.0 and
HTTP/1.1, complete and truncated Content-Length/chunked/HTTP2 responses,
empty and informational responses, partial headers, invalid TLS records,
and untrusted certificates. Timeouts are always test failures.

Original modulepreload referrer WPT improves from 9/16 to 16/16. The eight
generated dynamic-import referrer files that stopped at HTTPS fetches now
complete at 94/94, matching Chromium, and module regressions remain 44/44.
2026-11-22 02:01:56 +08:00
ldm0 0763502c58 fix(modules): preserve document policy for module preloads
Capture the exact Document's default referrer policy when preparing a
modulepreload request, separately from the module's persistent script options.
Carry it through single-module fetch reservations into the actual network
request, including main and child parser and connected-link paths.

Seed the HTML preload scanner with the response policy and snapshot meta
policies in token order for parser modules and modulepreload links. Seed
insertion scans with the live policy without scanning an idle Document.
Admit child links at FinishParsingChildren so a later meta in the same parser
batch cannot overwrite an earlier request's policy or duplicate link terminals.

Cover same/cross-origin requests, response and meta defaults, explicit and
invalid attributes, late meta tags, module-map reuse, and dynamic imports
from preloaded modules after a policy change with real HTTP regressions.
2026-11-22 02:01:56 +08:00
ldm0 7c3cde1263 fix(modules): apply document referrer policies to module graph fetches
Capture the exact Document's current referrer policy for each module fetch,
separately from compiled script options. Preserve explicit script and response
policies while allowing later imports with an empty policy to observe meta
policy changes. Resolve child policies through their Document and realm owner.

Carry the prepared module request through the main runtime root's Service
Worker path and its network fallback instead of rebuilding it without the
Document policy. Apply the same fallback to child parser roots.

Add real HTTP regression coverage for main and child documents, root and
static imports, saved classic/module import functions, string timers, explicit
and invalid policies, response policy overrides, and dynamic meta updates.
2026-11-22 02:01:55 +08:00
ldm0 161e3eda01 fix(modules): preserve dynamic import referrers and policies
Retain script referrer policy in V8 host-defined options, including imports
from saved functions and string timers. Carry the importing script's URL
through the module tree's existing referrer field into Fetch independently
of the document origin and cookie initiator. Keep the client referrer for
imports without referring script metadata.

Add real HTTP coverage for main and child documents, classic and module
scripts, inline and external sources, element mutation, response policies,
and direct and timer imports. Verify that an explicit script referrer does
not replace the document's origin or cookie context.
2026-11-22 02:01:55 +08:00
ldm0 664a5068cb fix(scripts): preserve dynamic import credentials from initiating scripts
Carry preparation-time fetch metadata through classic script execution and
child external-script ready tasks. Encode normalized credentials in V8
script origins so saved import functions retain their initiating script's
credentials after element mutation or removal.

Inherit credentials and nonce in string timers while clearing parser
metadata and keeping the root script's integrity out of dependency fetches.
Cover main and child documents, inline and external classic/module scripts,
credential defaults, same/cross-origin requests, and timer imports.
2026-11-22 02:01:55 +08:00
ldm0 ada4ae6f31 fix(modules): reuse compiled records for child script roots
Deliver compiled child root completions without requiring discarded
JavaScript source. Reuse the realm's existing record when each script
consumer advances, retaining its namespace, fetch metadata, response base
URL, and pending or rejected evaluation.

Cover preload, parser, runtime, and import consumers with real HTTP tests,
including redirect request keys, separate realms, per-element load events,
and top-level-await fulfillment and rejection identity.
2026-11-22 02:01:55 +08:00
ldm0 4358c97ea7 fix(modules): reuse module maps for runtime script roots
Consult the module map before fetching runtime module script roots while
preserving script-element Service Worker filtering and integrity checks.
Keep shared fetches alive across document.open so imports in the retained
realm settle without reviving retired script elements or their events.
2026-11-22 02:01:55 +08:00
ldm0 0a11b0d957 fix(build): adapt local runtime changes to upstream module split
Preserve the former visibility of ScriptVm methods after their implementations
move into submodules, and qualify navigation types outside their old import
scope. Retain the upstream module layout and the existing runtime behavior.

Validation: cargo fmt --all; workspace Clippy with all targets/features and
-D warnings; full nextest, 20,404 passed and 16 skipped.
2026-11-22 02:01:55 +08:00
ldm0 0272f736aa fix(preload): start runtime modulepreloads in their document
Start connected main-document modulepreloads during mutation commit using the
same module-map reservation and scheduling path as parser preloads. Route child
links through the existing Document/realm-owned modulepreload queue instead of
leaving their start requests in the main lifecycle accumulator.

Cover post-load JavaScript/JSON/CSS/text preloads, import reuse, asynchronous
load/error delivery, CORS and integrity failures, per-Window module maps, and
queued child starts retired by document.open.
2026-11-22 02:01:55 +08:00
ldm0 0ee884a05e test(dom): cover inactive Document locations 2026-11-22 02:01:55 +08:00
ldm0 b0706dbb19 fix(navigation): protect unload targets during descendant checks
Keep the navigation target protected from document.open/write/writeln while iframe and popup descendant beforeunload handlers run. Acquire the target counter after its reentry check so its own event still dispatches.

Cover target writes, guard release after the check, and writable intermediate documents with behavioral regressions.
2026-11-22 02:01:55 +08:00
ldm0 61549c3ee6 fix(navigation): check renderer history traversals before fetching 2026-11-22 02:01:55 +08:00
ldm0 da11ddb2f5 fix(navigation): check beforeunload before browser fetches
Run browser-initiated main-document checks through the existing asynchronous
lifecycle scheduler before Fetch interception or network loading. Project the
source turn first, reject superseded navigation tokens, and share navigation
finalization so failed checks retain the committed document and release state.
Foreground DevTools callers remain pending through the check and load, preserving
typed navigation results and the captured target owner.

Keep beforeunload and commit unload commands out of nested non-V8 Page-agent
dispatch while the owner is debugger-paused. Cover real navigate/reload/history
responses, retained documents, pause/resume, supersession, and Fetch ordering.
2026-11-22 02:01:55 +08:00
ldm0 91f630a125 fix(navigation): check the main document tree before navigating
Dispatch beforeunload across the source document tree before renderer navigation requests. Keep the source Location visible until commit and protect the navigation target from destructive writes in descendant callbacks. Cover lifecycle ordering, navigation reentry, removed descendants, source URL preservation and history policy snapshots.
2026-11-22 02:01:55 +08:00
ldm0 076a1fdd6d fix(navigation): preserve history referrer policies at commit 2026-11-22 02:01:55 +08:00
ldm0 b6276cf303 fix(navigation): preserve inherited top-level about:blank state 2026-11-22 02:01:55 +08:00
ldm0 7ad656c5fe fix(navigation): classify same-document navigation by URL fragments
Keep repeated fragment navigation within its Document for every history mode, including iframe and popup calls. Classify URLs without a fragment as cross-document before dispatching navigate, while preserving interception and cancellation.
2026-11-22 02:01:55 +08:00
ldm0 e7c944dc27 fix(navigation): honor sandboxed document origins
Disable Navigation API entries and tracking for top-level CSP sandbox origins while preserving actual fragment and cross-document navigation. Keep repeated fragment navigation in the same Document and honor explicit history behavior.
2026-11-22 02:01:55 +08:00
ldm0 cb82a4e0bf fix(navigation): preserve iframe documents on src fragment updates
Route native iframe attribute writes through shared same-document navigation. Preserve initial-document history replacement and pending document loads, and cover namespace and Attr mutations plus canceled navigation.
2026-11-22 02:01:55 +08:00
ldm0 dd1735bd96 fix(dom): retain inherited base URLs across history updates 2026-11-22 02:01:55 +08:00
ldm0 92dfa5ba5b fix(navigation): defer unload until document replacement 2026-11-22 02:01:55 +08:00
ldm0 d3017e3a3f fix(cdp): deliver current renderer notifications during navigation 2026-11-22 02:01:55 +08:00
ldm0 bd56b90042 fix(navigation): preserve documents on HTTP 204 and 205 responses 2026-11-22 02:01:55 +08:00
ldm0 0c90b1b7b1 fix(dom): expose cross-origin frames named by their container
Select the first child matching the target name, then expose it when it is
same-origin with its owner or the iframe name attribute publishes that name.
Keep child-authored names private and preserve WindowProxy DOM access checks.

Cover main, child and popup owners, renames, authorization changes, duplicate
ordering and removal. Preserve the existing named/indexed identity checks.

This follows Chromium's container-name behavior discussed in
https://github.com/whatwg/html/issues/12663. The two upstream same-origin-only
expectations remain documented compatibility differences.

Validation: cargo fmt --all; workspace clippy with all targets/features and
-D warnings; nextest 20,344 passed, 16 skipped. Normal CLI/CDP each improve
document_domain_access_details from 2/12 to 12/12; the 96-check container-name
matrix passes. All 18 upstream files remain in the comparison (67/81 subtests).
2026-11-22 02:01:55 +08:00
ldm0 21fcf09075 fix(dom): preserve trailing dots in document.domain
Keep trailing dots from URL host parsing and document.domain assignments so dotted and undotted domains remain distinct. Cover main, inherited, nested, and popup documents, along with encoded dots and public-suffix boundaries.
2026-11-22 02:01:55 +08:00
ldm0 1b70b13608 test(wpt): use registrable hostnames for loopback fixtures
Run both benchmark entrypoints on web-platform.localhost so the main host
is distinct from its public suffix. Resolve all named-host templates from
the configured primary host, preserving stable origins on subdomain
requests and keeping the alternate namespace separate.

Cover the server URL, hostname aliases, headers and both entrypoint
constructor calls. All 756 Python tests pass in the verified candidate;
the applied sources are byte-identical. The real Moli CLI and CDP
entrypoints each pass all 48 subtests across 13 original origin WPTs.
2026-11-22 02:01:55 +08:00
ldm0 f17230b49d fix(storage): enforce popup Window getter access checks
Expose popup localStorage and sessionStorage through the existing Window
accessors so opaque documents cannot bypass storage-origin and receiver
validation. Preserve the private cached objects and expose enumerable
accessor descriptors.

Add HTTP integration coverage for CSP and inherited sandbox policies,
allow-popups-to-escape-sandbox, cross-origin access, borrowed and forged
receivers, cached Storage before navigation, and queued popup close.
2026-11-22 02:01:55 +08:00
ldm0 fb2b4ddf11 fix(location): report URL origins for sandboxed documents
Keep the existing document-origin access checks, then serialize the URL
origin independently of sandboxing. This fixes HTTP and Blob locations
in opaque child documents and popups.

Cover 15 HTTP and local-URL scenarios, including borrowed getters and
unchanged Window/message origins. Strengthen the sandboxed Blob OPFS
regression to distinguish URL, Window and message origins while retaining
all handle-clone and storage-denial assertions.
2026-11-22 02:01:55 +08:00
ldm0 e3fcf9db67 fix(navigation): inherit document encoding from eligible containers
Capture the actual container Document's encoding and origin for child
navigation. Apply the same-origin and UTF-16 restrictions using the final
response URL and sandbox flags, including response CSP.

Decode local Blob and data navigations from response bytes. Keep popup
fallback independent of its opener and use UTF-8 for srcdoc snapshots.

Exercise nested frames, redirects, sandboxing, encoding precedence and
local URLs over real HTTP. Correct the existing MIME fixture's popup
fallback expectation while retaining all 64 iframe and popup cases.
2026-11-22 02:01:55 +08:00
ldm0 09d205310b fix(navigation): align document MIME and charset extraction 2026-11-22 02:01:55 +08:00
ldm0 e0a089cedc fix(fetch): queue Body completion on receiver fetch tasks 2026-11-22 02:01:55 +08:00
ldm0 30c168ae17 test: adapt WPT regressions to extracted modules
Remove duplicate test module registrations and fix the Window fixture include path after rebasing onto main. Preserve the preload fixture string and format migrated tests.
2026-11-22 02:01:55 +08:00