Commit Graph
40 Commits
Author SHA1 Message Date
ldm0 eac226d361 fix(stylesheets): evaluate parser media in the owning document 2026-11-03 07:53:58 +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 c2b4631360 fix(domparser): stop recovering element trees after XML prologue errors
Extracted from wpt-misc-fix (1b15b0f68b).

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 [ 126.296s] 20925 tests run: 20925 passed (9 slow), 19 skipped
2026-10-28 02:12:31 +08:00
ldm0 ba803e7b90 fix(xml): report malformed attributes while preserving namespace parsing
Check strict lexical XML errors before xml5ever tree construction. Cover six malformed attribute/name forms both alone and in a valid XHTML prologue, plus distinct xml:lang/lang namespaces.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (20283 passed, 18 skipped). Release v3 and five browser regression rounds. Full WPT recorded separately.

Original-commit: 0232344406
2026-10-21 17:55:02 +08:00
ldm0 e78f5a33b2 feat(layout): update Taffy and Stylo forks with current Blitz adapters
Move Taffy to 0.15 and Stylo to 0.22 using fixed fork revisions, with the
matching stylo_taffy adapter. Upgrade cssparser and the production HTML/XML
parsers while preserving the vendored XML behavior.

Adapt sizing inputs, baselines, grid positions, overflow and out-of-flow
ownership. Preserve font-stretch CSSOM compatibility and intrinsic sizing
through nested atomic inline probes.

Validation: root cargo fmt --all; strict workspace/all-target/all-feature
Clippy; Nextest 20280 passed, 18 skipped; Release build; five browser
regression rounds; RTL and nested intrinsic Chromium geometry controls.
Full WPT Cross is recorded separately with its Cases refresh.

Original-commit: 281a920d89
2026-10-21 17:55:02 +08:00
ldm0 e3538c8999 fix(stylesheets): honor quirks mode MIME compatibility 2026-10-12 17:17:55 +08:00
ldm0 2c8f19277b fix(xml): validate numeric references using the XML Char production
Validate XML numeric character references using the XML Char production rather than HTML recovery rules. Keep carriage returns and C1/noncharacter values which XML permits, and reject forbidden controls/surrogates. Parser regressions cover decimal and hexadecimal references and retain strict failures.
2026-10-10 03:44:51 +08:00
ldm0 19667e531a perf(dom): better inline script performance 2026-10-05 20:48:11 +08:00
ldm0 7a8362581a test(parser): continue decoded input after meta charset 2026-10-04 00:37:48 +08:00
ldm0 6aeffcf522 test(css): cover completed parser style contents and CSP checks 2026-10-01 22:49:41 +08:00
lanyue-llk 345ba4cbc4 fix(document): share literal text parsing across child document paths 2026-09-29 18:01:12 +08:00
lanyue-llk 9d236a20ef fix(parser): preserve text document MIME and encoding semantics 2026-09-29 18:01:12 +08:00
ldm0 a9830ab24b fix(csp): reject nonnonceable script elements
Apply the shared script nonceability check to parser scripts, buffered preloads and runtime script preparation. Suspicious script attribute names and values must not authorize execution merely because a nonce matches. Includes parser, preload and dynamic-preparation regressions.

The attribute checks follow the [CSP3 nonceability algorithm](https://www.w3.org/TR/CSP3/#is-element-nonceable), including case-insensitive `<link`, `<script` and `<style` matches and parser duplicate attributes.

Validation: all branch checks passed. Summary [ 115.690s] 18925 tests run: 18925 passed (9 slow), 16 skipped
2026-09-29 16:27:50 +08:00
ldm0 b6156fadc1 fix(parser): route XHTML template children through template contents 2026-09-27 03:07:54 +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
ldm0 60b9a8523e test(parser): cover deferred mutation interruption boundaries
Document the deferred flag as an undelivered callback notification. Cover
one-shot interruption across text, character references, comments and input
chunks, plus EOF with an incomplete character reference.
2026-09-24 19:22:52 +08:00
lanyue-llk 9abac5771d fix(parser): preserve pauses across mutation callbacks 2026-09-24 19:22:52 +08:00
ldm0 36ae738e6f fix(parser): preserve stylesheet pauses across encoding notices 2026-09-23 22:34:09 +08:00
lanyue-llk bcf420f622 revert: undo split PR 640 merges (#734-#740) 2026-09-22 20:02:07 +08:00
mini llk cba79021aa fix(document): parse text responses with consistent decoding (#740)
* fix(parser): preserve text document MIME and encoding semantics

* fix(document): share literal text parsing across child document paths

* fix(document): construct projection parser with the public API
2026-09-22 19:50:42 +08:00
ldm0 f645752894 fix(parser): notify mutations when coalescing text
Return text mutation effects from parser sinks and deliver them through the shared notification pipeline after releasing the structural borrow. This keeps stylesheets and layout current when parser input is merged into existing text nodes, and delivers characterData records without replacing node identity.

Add main-document and iframe regressions for split stylesheet input, hit testing, and MutationObserver delivery. Restore the verified elementsFromPoint iframe WPT to the passed list.
2026-09-17 14:17:33 +08:00
ldm0 4f7c4ffc0b refactor(parser): share mutation effects and isolate tokenizer pauses
Share parser mutation notifications between the main document and child
frames, with each owner retaining its resource and lifecycle work. Update
stylesheet owners incrementally so parser mutations preserve CSSOM edits.
Keep tokenizer pause reasons separate from DOM handle identity.

Add main/iframe regressions for reaction and observer ordering, form
association, stylesheet visibility, CSSOM edits, and nested frame identity.

Validation: cargo fmt --all; strict workspace clippy; cargo nextest run
--no-fail-fast (18,118 passed, 13 skipped).
2026-09-17 01:11:29 +08:00
ldm0 3dcfac5278 fix(parser): preserve reentrant insertion state and reaction order
Flush parser insertion reactions after the tree builder completes its current
token so connected callbacks run before children without retaining parser
borrows across JavaScript execution.

Keep one DocumentParserSession and expose a restricted insertion handle for
nested writes. Share input, suspension, cancellation, and close state so
blocked writes remain queued and outer feeds stop when nested parsing blocks
or replaces the document. Let the owning session finish deferred close and
dispatch readiness transitions once.

Reuse form-owner mutation detection for child parser insertions and add
regressions for reaction order, form association, nested writes, gated external
scripts, document replacement, and deferred close.

Validation: cargo fmt --all; strict workspace Clippy; cargo nextest run
--no-fail-fast (18,104 passed, 13 existing skips); release build.
2026-09-16 21:16:07 +08:00
ldm0 38b162da58 test(parser): cover customizable select wrapper parsing 2026-09-14 00:35:20 +08:00
ldm0 416936f732 fix(modules): enforce import-map integrity
Source-commit: 259f7aaa46
2026-09-12 06:40:39 +08:00
ldm0 e3f8765a34 fix(parser): treat empty HTML4 system IDs as quirks
Source-commit: 7f2172a42f
2026-09-11 00:31:21 +08:00
ldm0 5d99eb4ce8 fix(import-maps): enforce parser inline CSP
Source-commit: 7ddb9b78ed
2026-09-10 14:49:41 +08:00
ldm0 e666504594 refactor(parser): remove obsolete fragment APIs 2026-09-01 04:31:16 +08:00
ldm0 9953237e66 perf(parser): build fragments directly in live DOM 2026-09-01 04:31:16 +08:00
ldm0 28aaaa9e8a feat(cli): add disable-js fetch mode 2026-08-25 16:05:34 +08:00
ldm0 9e04a203d7 refactor(renderer): bind prepared scripts to exact document owners 2026-08-21 11:23:44 +08:00
ldm0 a142d011c0 refactor: extract HTML parser input stack 2026-08-20 23:39:45 +08:00
ldm0 a46043736e fix: preserve nested parser input order 2026-08-20 22:17:23 +08:00
ldm0 0d1b885eb0 build(deps): align html parser stack on 0.39 2026-08-17 01:26:26 +08:00
ldm0 d51be5bfc4 chore: fix clippy and document required checks 2026-08-13 07:07:00 +08:00
ldm0 3600404225 perf(parser): keep XML namespaces in token stream 2026-08-13 07:07:00 +08:00
ldm0 91c281d2c7 fix(parser): expose CDATA from xml5ever 2026-08-13 07:07:00 +08:00
ldm0 f2a2095751 fix(navigation): stabilize sequential CDP lifecycle 2026-08-13 07:07:00 +08:00
ldm0 27b5135cb6 Public preview 2026-08-11 00:10:12 +08:00