Commit Graph
10 Commits
Author SHA1 Message Date
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 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 29393a6cfb fix(dom): retain encodings in native Document state 2026-10-21 16:41:12 +08:00
ldm0 e3538c8999 fix(stylesheets): honor quirks mode MIME compatibility 2026-10-12 17:17:55 +08:00
ldm0 0f7fddbeb2 fix(dom): retain inherited base URLs across history updates 2026-09-30 10:53:38 +08:00
ldm0 981f9b15dd fix(dom): share host-including ancestry checks 2026-09-28 17:43:20 +08:00
ldm0 0d3d81829c fix(selectors): honor native document design mode 2026-09-27 18:38:08 +08:00
ldm0 27b5135cb6 Public preview 2026-08-11 00:10:12 +08:00