Commit Graph
3336 Commits
Author SHA1 Message Date
ldm0 350831da29 fix(performance): minimize resource timing content types 2026-11-02 06:02:26 +08:00
ldm0 f8c2607c5e fix(runtime): reconcile WPT changes with native state on main
Restore native History cursors from sparse serialized positions, preserve
shared Window history across isolated realms, and keep entry identity and
structured state through document.open and cross-realm settlement.

Move event subclass and precommit state access onto shared native backing.
Respect published iframe layout snapshots and align history, rendering,
and rejection tests with their owning task boundaries. Remove duplicate
upstream tests and obsolete helpers from the main rebase.

Validation: cargo fmt --all; workspace/all-targets/all-features Clippy with
-D warnings; full Nextest (20,319 passed, 16 skipped); fresh CLI HTTP/CDP
fetch resource timing fixture (36/36). Build and tests used 32-way parallelism.
2026-11-02 06:02:26 +08:00
ldm0 782f556905 fix(performance): report Window fetch resource timing
Report registered Window fetches at body completion, failure, and cancellation
in the request client realm. Keep original URLs, native entry state, preload
suppression, and one terminal entry across clones and late completions.

Separate CORS-visible body metadata from TAO-protected timing and transfer
size, including redirect taint and quoted/repeated TAO header fields.

Validate 36 real HTTP scenarios and isolate preload fixture timing buffers.
Workspace fmt, all-target/all-feature Clippy, and 20,255 Nextest tests pass.
2026-11-02 06:02:26 +08:00
ldm0 32bf2eb0c7 fix(performance): inherit navigation timing from resource entries 2026-11-02 06:02:26 +08:00
ldm0 a2cc617b71 fix(performance): bind legacy timing to native state 2026-11-02 06:02:26 +08:00
ldm0 b38e7293b8 fix(webidl): expose readonly ResizeObserver result snapshots 2026-11-02 06:02:26 +08:00
ldm0 82f852034a fix(performance): validate receivers and support worker buffer state
Route Performance methods and attributes through native WebIDL brands so
invalid receivers fail before author code, with errors from the callee realm.
Remove the duplicate callback-local slot checks.

Share native resource-buffer configuration with worker contexts instead of
requiring a page host. Preserve owner isolation and context-owned cleanup.

Cover Window/iframe and Dedicated Worker receiver behavior, borrowed timing
operations, registry isolation, and worker teardown. Validated with fmt,
workspace Clippy, 20,250 Nextest tests, CLI probes, and 20 upstream WPT cases.
2026-11-02 06:02:26 +08:00
ldm0 78e85d927d fix(observers): sample targets across top-level documents
Opener observers could report an initial non-intersecting popup target but
miss its insertion, and ResizeObserver sampled zero-sized popup targets.
The rendering update only refreshed the observer's Document, while a shared
latest-layout slot let independent top-level Documents overwrite each other.

Keep each popup's latest layout and matching metrics in its current Document
record, and refresh the distinct target/root Documents before broadcasting.
Document replacement and committed close release the corresponding snapshot;
iframe viewport invalidation preserves snapshots owned by other windows.

Cover opener/iframe observers across Documents, popup replacement and close,
and iframe attribute invalidation and removal. Share browser-facing scenarios
between native regression tests and the Chromium/Moli CDP comparison.
2026-11-02 06:02:26 +08:00
ldm0 8dcdded2d1 fix(observers): validate native element targets across documents
Resolve observer Element and root arguments through native interface brands and live or detached node identities. Preserve registered native proxies, entry identity, and WebIDL conversion order.

Schedule initial intersection notifications from the rendering document and cover adoption, explicit roots, invalid targets, and native proxy sampling with shared browser probes. Align the root-scope fixture with initial non-intersecting entries.
2026-11-02 06:02:26 +08:00
ldm0 6bccdd8847 fix(observers): preserve intersection notification ordering
Keep targets in observe() order across duplicates, unobserve/reobserve and DOM
reordering. Remove targets without changing the relative order of survivors.

Snapshot only the observer list when notifying. Drain each queue immediately
before its callback so earlier callbacks and microtasks can takeRecords() or
cancel pending observations. Revalidate Document and callback realm ownership
between deliveries.

Validation: fmt and workspace Clippy passed; Nextest 20,242 passed, 16 skipped.
Original multiple-targets WPT passed 20/20 repetitions (baseline 2/20); 14 related
WPT pages have no new failures. Shared behavior probes match Chromium.
2026-11-02 06:02:26 +08:00
ldm0 f129ea9515 fix(observers): align notifications with document rendering
Run ResizeObserver after animation callbacks using depth-limited broadcasts
and freshly published layout, then apply focus fixup and sample intersections.
Deliver IntersectionObserver callbacks in a separate exact-Document task.

Preserve constructor order and active observer lifetime in the native registry;
validate Document and realm ownership across callbacks and bound reentrant work.
Sample padding, logical axes, inline boxes and device-pixel zoom from frozen
layout, including iframe geometry, and wake rendering after CSSOM changes.

Validation: fmt and workspace Clippy passed; Nextest 20,240 passed, 16 skipped.
Selected ResizeObserver WPT: 7 pages / 46 subtests passed. 153 original WPT pages
have no new failures; focus and navigation probes passed 31 and 152 cases.
2026-11-02 06:02:26 +08:00
ldm0 5542e11da6 fix(focus): revalidate DOM focus during rendering updates
Coalesce native focus checks with the owning Document's animation-frame wake
and revalidate focusability after callbacks. Remove the fieldset-only
synchronous blur and the dependency on author-modifiable setTimeout.

Keep pending checks bound to their exact Document across document.open and
Window retirement. Bound change/blur handlers and their cleanup microtasks
with the execution watchdog.

Cover focusability changes, restored focus, native scheduling, shadow and
child documents, replacement, retirement, reentrancy, and timeout recovery.
Adapt the vendored nested-fieldset test to HTML's asynchronous focus-fixup
requirement and document its difference from the original upstream test.
2026-11-02 06:02:26 +08:00
ldm0 83e6b90aee fix(focus): preserve sequential navigation positions across DOM mutations
Track navigation origins as elements or native DOM boundary points, and
update them through existing removal, movement and text-split notifications.
Use shadow-including DOM order when the origin is outside the tab order.

Keep navigation positions independent of Selection, reset focus through
shadow hosts on self-replacement, and retain the detached-insertion fast
path when no live ranges exist. Cover both Tab directions with and without
a DOM Selection.
2026-11-02 06:02:26 +08:00
ldm0 fde73b3cae fix(selection): separate visible text control selections from cached ranges 2026-11-02 06:02:26 +08:00
ldm0 5986b35d99 fix(selection): restore focused text control ranges after clearing
Restore the owning Document's Selection after successful text selection
setters, including unchanged cached offsets. Reuse the existing projection
in the owner realm and reset the focused control's cached offsets when
clearing its Document Selection.

Cover parent/child realms, shadow trees, cleared/replaced ranges, argument
conversion side effects, and isolated background controls.
2026-11-02 06:02:26 +08:00
ldm0 b5d2f8db61 fix(selection): sync Range mutations with the owning document
Resolve an associated Selection through the native Range record and its owning Document, independently of the Range creation realm or borrowed method realm. Share native document membership checks with addRange and getRangeAt, and clear associations when explicit Range mutations leave that document.

Route direct and relative boundary setters through the same adjustment and synchronization path. Keep composed direction and type when a DOM Range projects a span across shadow roots.

Cover cross-realm ownership, detached trees, explicit reattachment, cloned and replaced ranges, invalid boundaries and author getters. Validate 448 ownership combinations and 36 direction/type scenarios against Chromium, while preserving validation-before-mutation semantics for invalid foreign offsets.
2026-11-02 06:02:26 +08:00
ldm0 c9bcd4eddb fix(selection): preserve composed state across shadow trees
Keep composed selection direction independent of its public Range projection. When extend() crosses DOM roots, create a new caret at the focus without modifying the previously associated Range.

Track composed positions through native text edits, splits and removals, including child-document mutations invoked through borrowed parent-realm methods. Share text boundary rules with live ranges and remove the current-Window-specific removal path.

Add browser-matched coverage for open and closed shadow trees, parent offsets, UTF-16 mutations, range identity and cross-realm ownership.
2026-11-02 06:02:26 +08:00
ldm0 2bc5baeb66 fix(focus): initialize selections in contenteditable hosts
Initialize the native caret before focus events in the editing host owner realm, retaining existing host selections and their Range identity. Preserve UTF-16 offsets, whitespace and shadow projections, and queue document selectionchange through the existing task queue.
2026-11-02 06:02:26 +08:00
ldm0 49f2313778 fix(selection): validate range membership with native DOM ownership 2026-11-02 06:02:26 +08:00
ldm0 0f69d75bf9 fix(selection): project focused text controls into document ranges 2026-11-02 06:02:26 +08:00
ldm0 3fc3c43658 fix(focus): align native focusability across element namespaces 2026-11-02 06:02:26 +08:00
ldm0 26be618723 fix(focus): publish focus state at each event phase
Expose the old Document's viewport during blur and focusout, then commit the
new focus before focus and focusin. Preserve completed reentrant transitions,
revalidate target ownership and focusability, and suppress stale focus events.

Track viewport ownership across child Documents so ancestor activeElement
remains the iframe while the child blurs, and retire that focus on removal.
Preserve shared :focus-within ancestors during blur. Keep relatedTarget within
its Document and cover event state, computed styles,
reentry, text-change commitment, shadow roots and frame transitions.
2026-11-02 06:02:26 +08:00
ldm0 b7f2387350 fix(focus): process autofocus candidates from child documents
Join child candidates to their active top-level Document's queue in connection
order. Revalidate ownership and ancestor fragments when flushing, and preserve
blocked candidates until their own Document's stylesheet readiness settles.

Construct focus transitions in the target Document's realm using the intrinsic
FocusEvent with its view, without consulting author constructors or inherited
initialization getters. Cover queue ownership, retirement, policies, stylesheet
wakes, and cross-realm focus event behavior.
2026-11-02 06:02:26 +08:00
ldm0 a8650a9bc2 fix(focus): consume autofocus candidates in focused documents
Keep pending autofocus rendering work when author code has already focused an
element. At rendering time, either complete the one-time autofocus decision or
focus the candidate if the author blurred before that opportunity.

Cover main and popup insertion, DOMContentLoaded microtask focus, and late
candidates after blur so skipping admission cannot revive stale autofocus.
2026-11-02 06:02:26 +08:00
ldm0 3153df10ff fix(focus): scope autofocus to top-level documents
Give live main and popup Documents independent candidate queues and completion
flags. Admit parser and DOM API insertions through shared mutation notifications,
then flush on the owning rendering task or before its animation-frame callbacks.

Preserve document.open state, retire replaced Documents, enforce the response
policy, and resolve image-map associations in the owning Document. Clear removed
focus anchors so iframe reinsertion cannot revive a stale autofocus blocker.
2026-11-02 06:02:26 +08:00
ldm0 1a04fd6c7e fix(scheduling): dispatch animation frames as rendering batches
Keep callback maps and cancellation handles with their Window lifetime.
Use timer deadlines only to publish exact-Document rendering tasks, then
flush autofocus and invoke an ordered callback snapshot with one native
timestamp and a checkpoint between callbacks.

Preserve document.open state, validate retired callback realms, and retain
watchdog protection. Consume rejected autofocus candidates so subsequent
frames cannot revive them without reinsertion.
2026-11-02 06:02:26 +08:00
ldm0 8ca853e0c4 fix(focus): schedule late autofocus candidates 2026-11-02 06:02:26 +08:00
ldm0 f69c15c90a fix(focus): preserve autofocus candidate insertion order 2026-11-02 06:02:26 +08:00
ldm0 0b3d01ff5d fix(html): remove obsolete area hreflang and type properties 2026-11-02 06:02:26 +08:00
ldm0 8b602101b1 fix(html): implement select showPicker preconditions 2026-11-02 06:02:26 +08:00
ldm0 ce55355864 fix(sandbox): propagate creator restrictions to element popups 2026-11-02 06:02:26 +08:00
ldm0 7b57f89a77 fix(csp): preserve sandboxed origins across popup documents 2026-11-02 06:02:26 +08:00
ldm0 c2ead1bfb8 test(wpt): reconcile measured case statuses after main rebase 2026-11-02 06:02:26 +08:00
ldm0 eefa743649 test(wpt): deduplicate worker import regression after main rebase 2026-11-02 06:02:25 +08:00
ldm0 95b7349115 test(wpt): remove regression fixtures duplicated by main 2026-11-02 06:02:25 +08:00
ldm0 60f94cd4d3 fix(layout): adapt WPT input to explicit published snapshots 2026-11-02 06:02:25 +08:00
ldm0 20bef73cfa fix(history): preserve traversal settlement and owner-scoped cancellation 2026-11-02 06:02:25 +08:00
ldm0 cbcf0f3f09 fix(runtime): adapt WPT document lifecycle callbacks to main 2026-11-02 06:02:25 +08:00
ldm0 fe9b099081 fix(iframe): recreate child contexts on ordinary reinsertion 2026-11-02 06:02:25 +08:00
ldm0 cf9f797372 fix(window): honor scroll receiver and WebIDL argument semantics
Capture and authorize the Window receiver before converting scroll arguments,
then apply the operation only to that Window's surviving execution context.
Keep popup offsets on their canonical Window instead of the creator global.

Use derived ScrollToOptions and unrestricted-double converters, including
overload selection, conversion order, exception propagation and non-finite
normalization. Return successful Promises in the receiver realm and use the
shared Promise binding adapter for receiver and conversion rejections.

Cover borrowed methods, native/forged/proxy receivers, argument reentrancy and
receiver removal. The upstream window-scroll-arguments WPT improves from 6/12
to 12/12; the 104-case comparison has no lost passing cases or subtests.
2026-11-02 06:02:25 +08:00
ldm0 0fcf792022 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-02 06:02:25 +08:00
ldm0 a00e290fce 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-02 06:02:25 +08:00
ldm0 b75e3c72a7 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-02 06:02:25 +08:00
ldm0 df6d5cd834 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-02 06:02:25 +08:00
ldm0 1b1cbcd3b1 fix(parser): register window handlers from merged body attributes 2026-11-02 06:02:25 +08:00
ldm0 fd70a715e0 fix(storage): deliver localStorage events across pages 2026-11-02 06:02:25 +08:00
ldm0 5892dba539 fix(window): resolve named iframe targets from the receiver 2026-11-02 06:02:25 +08:00
ldm0 f7007fe6d5 fix(navigation): prefer source frame in named target lookup 2026-11-02 06:02:25 +08:00
ldm0 d8070728c8 fix(forms): preserve queued submissions before javascript URLs 2026-11-02 06:02:25 +08:00
ldm0 71ad53d9fd fix(forms): honor Get action URL submission rules 2026-11-02 06:02:25 +08:00