Commit Graph
4539 Commits
Author SHA1 Message Date
ldm0 04b79143cd 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-24 14:34:55 +08:00
ldm0 c782f0111c 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-24 14:34:55 +08:00
ldm0 e878109a9c fix(selection): separate visible text control selections from cached ranges 2026-11-24 14:34:55 +08:00
ldm0 9def22fee6 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-24 14:34:55 +08:00
ldm0 b474b7798c 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-24 14:34:55 +08:00
ldm0 c420286ba5 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-24 14:34:55 +08:00
ldm0 684cd5d949 fix(selection): validate range membership with native DOM ownership 2026-11-24 14:34:55 +08:00
ldm0 af30458b5b fix(selection): project focused text controls into document ranges 2026-11-24 14:34:55 +08:00
ldm0 c61dbbbb6f fix(focus): align native focusability across element namespaces 2026-11-24 14:34:55 +08:00
ldm0 13d41a1d16 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-24 14:34:55 +08:00
ldm0 bc7c3bfdc8 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-24 14:34:55 +08:00
ldm0 2f44197e31 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-24 14:34:55 +08:00
ldm0 67b301cdc5 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-24 14:34:55 +08:00
ldm0 54e0f91c8a 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-24 14:34:55 +08:00
ldm0 b24dcff4b4 fix(focus): schedule late autofocus candidates 2026-11-24 14:34:55 +08:00
ldm0 455e944fd5 fix(focus): preserve autofocus candidate insertion order 2026-11-24 14:34:55 +08:00
ldm0 14daddafe6 fix(html): implement select showPicker preconditions 2026-11-24 14:34:55 +08:00
ldm0 a0bf6da6e4 fix(sandbox): propagate creator restrictions to element popups 2026-11-24 14:34:55 +08:00
ldm0 0061bb96b3 fix(csp): preserve sandboxed origins across popup documents 2026-11-24 14:34:55 +08:00
ldm0 8b0260321c test(wpt): reconcile measured case statuses after main rebase 2026-11-24 14:34:55 +08:00
ldm0 d0b5283cf3 test(wpt): deduplicate worker import regression after main rebase 2026-11-24 14:34:55 +08:00
ldm0 900947a8df test(wpt): remove regression fixtures duplicated by main 2026-11-24 14:34:55 +08:00
ldm0 af3609a0ad fix(layout): adapt WPT input to explicit published snapshots 2026-11-24 14:34:55 +08:00
ldm0 e5cf16f9a6 fix(history): preserve traversal settlement and owner-scoped cancellation 2026-11-24 14:34:55 +08:00
ldm0 dd554df3a4 fix(runtime): adapt WPT document lifecycle callbacks to main 2026-11-24 14:34:55 +08:00
ldm0 e529f720e8 fix(iframe): recreate child contexts on ordinary reinsertion 2026-11-24 14:34:55 +08:00
ldm0 b54aea7fad 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-24 14:34:55 +08:00
ldm0 bd7f2e255c 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-24 14:34:55 +08:00
ldm0 446ecc3fda 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-24 14:34:55 +08:00
ldm0 475325eb80 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-24 14:34:55 +08:00
ldm0 d7e32358d0 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-24 14:34:55 +08:00
ldm0 5de9d7dc51 fix(parser): register window handlers from merged body attributes 2026-11-24 14:34:55 +08:00
ldm0 aea1171860 fix(storage): deliver localStorage events across pages 2026-11-24 14:34:55 +08:00
ldm0 00730a91b8 fix(window): resolve named iframe targets from the receiver 2026-11-24 14:34:55 +08:00
ldm0 ea1ddb7e39 fix(navigation): prefer source frame in named target lookup 2026-11-24 14:34:55 +08:00
ldm0 63f42b8cec fix(forms): preserve queued submissions before javascript URLs 2026-11-24 14:34:55 +08:00
ldm0 2a8c2a68e6 fix(forms): honor Get action URL submission rules 2026-11-24 14:34:55 +08:00
ldm0 002f923e83 fix(navigation): enforce child javascript URL origin checks 2026-11-24 14:34:55 +08:00
ldm0 0beff201b0 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-24 14:34:55 +08:00
ldm0 5063925bee fix(window): preserve popup roots for nested frames 2026-11-24 14:34:55 +08:00
ldm0 5bc52e4511 fix(navigation): validate child ancestor navigation permissions 2026-11-24 14:34:55 +08:00
ldm0 30473677bd fix(navigation): complete popup document unload lifecycle 2026-11-24 14:34:55 +08:00
ldm0 01b0f1499d fix(iframe): reject ancestor URLs during attribute navigation 2026-11-24 14:34:54 +08:00
ldm0 c5aeb3ea16 fix(navigation): check child beforeunload before loading 2026-11-24 14:34:54 +08:00
ldm0 3b2855081d fix(location): preserve entry settings during proxy forwarding 2026-11-24 14:34:54 +08:00
ldm0 c28ad05f7b fix(window): derive popup referrers from the entry document 2026-11-24 14:34:54 +08:00
ldm0 db9d50cf14 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-24 14:34:54 +08:00
ldm0 7542822ceb test(workers): cover URL-like module specifier resolution 2026-11-24 14:34:54 +08:00
ldm0 51e20d1b16 fix(workers): reject dynamic imports in service workers 2026-11-24 14:34:54 +08:00
ldm0 dee6304cf5 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-24 14:34:54 +08:00