Commit Graph
69 Commits
Author SHA1 Message Date
ldm0 830dbac358 fix(dom): compare foreign node trees in their own arenas 2026-11-01 18:27:24 +08:00
ldm0 15812c1d21 feat(dom): retain delivered meta referrer policy on each Document
Retain valid delivered meta referrer policies on their native owner Document. Preserve delivery ordering and independent cloned Document state.

Validation (32 build jobs / test threads, zero retries):

- `cargo fmt --all`
- `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- `cargo nextest run --no-fail-fast`: Summary [ 133.798s] 21996 tests run: 21996 passed (9 slow), 19 skipped
2026-10-31 18:55:48 +08:00
ldm0 31e00c3feb fix(dom): record same-value namespace attribute writes
Queue observer records for every same-value attribute write, including setAttributeNS and dataset. Keep meta declaration processing independent so it does not queue a duplicate record.
2026-10-29 15:39:43 +08:00
ldm0 8cdb89fc14 fix(html): use actual attribute identities for meta refresh
Report the matched Attr local name and namespace from ordinary and namespace-aware writes, then match refresh attributes exactly. Cover unrelated uppercase/namespaced mutations and ordinary HTML case folding in both main and child Documents.
2026-10-29 15:39:43 +08:00
ldm0 7f08c25f08 fix(dom): preserve template document identity and adoption lifecycles
Share a lazy inert owner across each document's template contents and keep
HTML/XML semantics, interface identity, and template-owner state separate.
Cloning preserves interfaces while creating independent owner state.

Separate portable Document metadata from arena-local relationships. Use
one metadata-copy boundary for Document cloning and main-document
replacement, clearing template-owner and CSS-target handles while keeping
whole-DOM snapshots and copy-on-write storage relationships intact. Metadata
copies also discard base-element href/target caches while retaining about
base URLs and explicit overrides; only DOM node cloning freezes computed
base URLs. Detached Document URL readers use native metadata without JS
URL/documentURI/baseURI shadow state, including selector and bridge readers.

Apply the DOM-specific document cloning rules separately: freeze the source
computed base URL as an override, separately retain the inherited about
base URL, and rebuild base-element caches from the cloned tree. Preserve
main-document replacement metadata semantics.

Establish exact HTML template identity and associated fragment allocation
in one native entry shared by DOM and parser creation. Clone actual native
contents rather than guessing from names, preserving foreign and mixed-case
elements through serialization, deep cloning, import and adoption. Keep HTML
createElement normalization at its binding boundary; namespace-aware creation
and wrapper selection preserve the exact local name, including registry paths.

Plan per-node adoption targets across ordinary children, shadow roots and
template contents. Retarget custom-element registries and callbacks with
the actual destination documents, and clear cross-document shadow sheets
while retaining sheets within a document and its own template owner.
Avoid preparing unused inert style sources.

Cover cross-arena ID collisions, metadata preservation, snapshot isolation,
nested templates, deep adoption, iframe/detached documents, cloned
interfaces, retained sheet arrays, registry associations and URL behavior.
2026-10-29 02:54:08 +08:00
ldm0 5ea0c64479 fix(dom): expose inert template documents through Document
Track the inert template-document role separately from HTML/XML semantics.
Choose the Document wrapper for that role while preserving the source kind
for HTML name normalization and XML element creation.

Cover parser/createElement/innerHTML paths in main and child documents,
DOMParser and createHTMLDocument sources, and XHTML contents. Ordinary
Document interfaces retain their existing identity.

Validation: cargo fmt --all; strict workspace/all-targets/all-features
Clippy; 86 template-related tests across three stress iterations; full
Nextest 21,167 passed, 19 skipped, without retries.
2026-10-28 15:07:56 +08:00
ldm0 93aa0dba93 fix(dom): retain lossless DocumentType strings in native copies
Extracted from wpt-misc-fix (4ecc927d5c).

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (32 build jobs / test threads).
Summary [ 130.006s] 20886 tests run: 20886 passed (9 slow), 19 skipped
2026-10-26 18:02:49 +08:00
ldm0 b2fc3dd65c fix(html): preserve child meta refresh with shared scheduling
Process parser and script-created refresh declarations in order and retain them
on their owning Document across load callbacks and adoption. Share candidate
priority and deadline state between main and child documents, and arm child
timers after owner load completes.

Consume queued work by exact Document identity and revision, classify navigation
when it fires, and keep the registered target URL. Reprocess same-value meta
attributes using the matched Attr identity so XML case, namespaces, observer
records, and refresh deadlines remain correct.

Cover competing declarations, stale tasks, independent frames, load/adoption
boundaries, sandbox/shadow handling, saved targets, and fragment navigation.
2026-10-26 03:17:22 +08:00
ldm0 4b6a02470c fix(dom): preserve native Element identities when copying between documents 2026-10-25 03:40:03 +08:00
ldm0 29393a6cfb fix(dom): retain encodings in native Document state 2026-10-21 16:41:12 +08:00
ldm0 4ee081b81b fix(dom): retain default mute state until an explicit preference 2026-10-18 05:18:47 +08:00
ldm0 e0df01a2cd fix(dom): retarget adopted shadow trees before reinsertion
Retarget ShadowRoot ownership and descendants along with the adopted host,
and collect stylesheet owners from nested shadow trees. Cover closed and
nested roots, inactive documents, and deep iterative adoption.
2026-10-17 20:09:30 +08:00
ldm0 5be5f7c50d feat(pdf): preserve clickable links and internal destinations 2026-10-13 00:34:09 +08:00
ldm0 68408732cb fix(input): align mouse click targeting with Chromium
Keep press and current mouse targets in host-owned state so synchronous
DOM removals invalidate or retarget them before click dispatch. Resolve
click and auxclick targets through the flat tree, preserve captured click
targets, and dispatch mouseup before lostpointercapture.

Cover sibling targets, Shadow DOM, slots, removal and reinsertion, and
pointer capture with deterministic input regressions.
2026-10-12 18:58:56 +08:00
ldm0 e3538c8999 fix(stylesheets): honor quirks mode MIME compatibility 2026-10-12 17:17:55 +08:00
ldm0 b1d06cde76 fix(domparser): retain HTML document parse modes 2026-10-12 17:08:29 +08:00
ldm0 f9fd34422a feat(dom): add lossless native DOM string values
Add the native DOMString value representation that preserves unpaired UTF-16 code units and exposes a scalar projection for native consumers. Equality and hashing retain original units; parser scalar appends preserve allocation capacity. Unit coverage includes surrogate identity and append boundaries. This PR provides the native value API; migrating all DOM producers is separate work.
2026-10-10 18:30:37 +08:00
ldm0 4997e6d0d3 fix(accessibility): project computed visibility and composed names 2026-10-10 11:53:21 +08:00
ldm0 111afae3bb feat(svg): expose native value and element interfaces
Completes native SVG value and element interface exposure in one independently mergeable PR against main, refreshing the former SVG constructor PR. Animated scalar values, angles, preserve-aspect-ratio values and live point/string/number/length/transform lists provide the shared native DOM foundation for the added elements.

Adds the remaining component-transfer, flood, image, merge, merge-node and tile filter interfaces; SVGSwitchElement and SVGMPathElement; and the animation, animate, set, animate-motion and animate-transform interfaces. Native factories, inheritance, SVGTests lists, attribute reflection, receiver validation and animation event handlers use native objects and the existing DOM backend.

Tests cover main/iframe realms, live and windowless documents, native identity, value/list mutation, units, Trusted Types, animation target resolution, handlers and timing argument validation. All internal SVG dependencies are included here, with no external PR merge order.

Filter raster rendering and SMIL scheduling remain unimplemented. Timing controls reject NotSupportedError, getStartTime reports no interval, and getCurrentTime remains zero. The separate SVG path parser changes and animated-string UTF-16 storage migration are excluded. The retained length synchronization is included; a separate ignored regression records the lone-surrogate limitation in the current DOM attribute storage.

SVG event-handler properties reuse main's existing shared event backend. Tests verify replacement, clearing, canonical event types, cancellation and realm/receiver identity; complete handler/listener registration-order semantics remain part of the separate event-handler backend migration.
2026-10-09 14:54:14 +08:00
ldm0 8bb9c18f22 fix(forms): finalize clean input values after parser attributes 2026-10-07 14:11:22 +08:00
ldm0 30e36e64a3 fix(cdp): preserve auxiliary Page ownership through document navigation
Create script auxiliary Pages synchronously and let their CDP targets adopt
those exact Pages. Preserve Page and WindowProxy identity through document
navigation, sharing browsing-context names, opener references, message endpoints
and close state with related windows.

Commit browser responses into the existing Page with exact document admission,
cancellation and failure disposition. Capture accepted navigation origin, base,
policy, storage and referrer, preserve auxiliary history and restore related
browsing-context groups without issuing duplicate popup requests.

Reuse the initial same-origin Window while replacing its Document, and centralize
Document owner transitions, descendant retirement and Inspector publication.
Give related Pages independent Inspector routes and shared per-Page startup
pause state, route isolate foreground work through surviving Pages, and cache
cross-origin Window functions in each accessing realm with receiver-aware access.

Cover actual popup state, navigation and parser rebinding, accepted environments,
history, cross-origin access, multiple frontends, cancellation and task retirement.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-06 01:01:03 +08:00
ldm0 19667e531a perf(dom): better inline script performance 2026-10-05 20:48:11 +08:00
ldm0 ca0a4c81a2 feat(webmcp): add native form schemas, fill intents, and activity states
Introduce moli-webmcp for native form schema synthesis, complete input validation,
numeric conversion, and JSON-LD results. Preserve requested selection values in
fill intents so the renderer can apply them to current controls after author
input events.

Add native tool activity states, selector support, control helpers, and
a namespace-aware form index that includes open and closed shadow trees.
Pin the Stylo revision providing the activity pseudo-classes.

Validation on this commit tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast.
Summary [  98.804s] 19248 tests run: 19248 passed, 16 skipped
2026-10-05 15:25:06 +08:00
ldm0 bc116c16dc fix(dom): match class-name collections using document quirks mode 2026-10-03 17:40:52 +08:00
ldm0 4b71c1628a feat(svg): expose native switch and mpath interface objects 2026-10-03 04:04:27 +08:00
ldm0 0b7081a51a feat(svg): expose native animation element interface objects 2026-10-03 03:00:13 +08:00
ldm0 90ffad4035 feat(svg): expose remaining filter element interfaces 2026-10-03 02:58:43 +08:00
ldm0 9a81b5695f fix(forms): honor range input constraints 2026-10-02 02:13:13 +08:00
ldm0 2b5657d6e6 perf(dom): bound indexed queries by the subtree size 2026-09-30 17:32:09 +08:00
ldm0 0f7fddbeb2 fix(dom): retain inherited base URLs across history updates 2026-09-30 10:53:38 +08:00
ldm0 daf6edd4e3 fix(dom): preserve fragment insertion mutation boundaries 2026-09-30 10:37:18 +08:00
ldm0 c12e9f8416 perf(forms): resolve named items from indexed candidates 2026-09-29 15:23:17 +08:00
lanyue-llk 468729e7de fix(forms): preserve live and detached named property semantics 2026-09-29 07:54:26 +08:00
ldm0 981f9b15dd fix(dom): share host-including ancestry checks 2026-09-28 17:43:20 +08:00
ldm0 fa1bf1d3be fix(selection): validate range membership with native DOM ownership 2026-09-28 10:22:57 +08:00
ldm0 0d3d81829c fix(selectors): honor native document design mode 2026-09-27 18:38:08 +08:00
ldm0 c2c5ce0da0 fix(forms): sanitize multiple and IDN email values 2026-09-27 05:50:50 +08:00
ldm0 511c8a2341 refactor(parser): centralize element construction lifecycles
Separate parser provenance from active child construction. Share one
construction session across HTML/XML parsers and runtime adapters, with
completion ownership, normal-EOF checks, and cancellation that does not
publish incomplete styles.

Use ordinary creation for generated document shells and remove obsolete
per-element completion forwarding. Cover parser ownership, adoption,
duplicate completion, missing callbacks, and cancellation in tests.
2026-09-26 07:01:12 +08:00
ldm0 83e0afd1a1 fix(css): avoid reparsing incomplete inline styles
Process parser-created style sources after their closing tag or EOF, and
prepare later source changes through the stylesheet owner lifecycle.
Keep synchronization and CSSOM reads on prepared sources so CSSOM edits
survive reads and document initialization.

Complete styles in inert XML parsing and build the XML viewer through
ordinary DOM creation. Cover streaming, EOF, child documents, fragments,
and XML stylesheet behavior in regression tests.
2026-09-26 07:01:12 +08:00
Donough Liu 747559e0a1 fix(dom): synchronize element reflection targets (#764) 2026-09-23 04:44:00 +08:00
Donough Liu d637221990 fix(dom): expose live HTMLCollections on every Document (#762) 2026-09-23 04:43:47 +08:00
lanyue-llk bcf420f622 revert: undo split PR 640 merges (#734-#740) 2026-09-22 20:02:07 +08:00
mini llk e979f50c33 fix(forms): preserve live and detached named property semantics (#739) 2026-09-22 19:50:01 +08:00
ldm0 61dbf7ea3e feat(markdown): introduce moli-html2md 2026-09-16 16:07:15 +08:00
ldm0 14949fd862 fix(dom): include CDATA in child text content
Extract an independently mergeable topic from wpt-misc-fix at
a70a96f9d1.

Register the child text content regression module without including later script test modules.
Include the XML document fixture route used by the CDATA regression so this branch does not depend on the separate XML input-stream changes.

Source commits:
- 7f587e1251
- ae3a3f1096

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
2026-09-10 05:50:52 +08:00
ldm0 e194c2add8 refactor(html): centralize input type states
Extract an independently mergeable topic from wpt-misc-fix at
a70a96f9d1.

Source commits:
- 05e2cd5350

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast
2026-09-10 04:05:23 +08:00
ldm0 e47538d58f fix(html): preserve user-edited state in control clones 2026-09-05 03:50:26 +08:00
ldm0 dd24293221 perf(dom): compact singleton named candidates 2026-09-05 03:18:34 +08:00
ldm0 2c7a46352d perf(dom): compact named index strings 2026-09-05 00:51:49 +08:00
ldm0 bf82c1a10b perf(dom): share named index values 2026-09-05 00:51:49 +08:00