Skip to content

Add opt-in legacy DOM reads and regression coverage - #203

Open
jdalton wants to merge 1 commit into
dperini:masterfrom
jdalton:feat/legacy-dom
Open

Add opt-in legacy DOM reads and regression coverage#203
jdalton wants to merge 1 commit into
dperini:masterfrom
jdalton:feat/legacy-dom

Conversation

@jdalton

@jdalton jdalton commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Tooling update

Rebased onto merged #212 as one commit. Sources and tests use .mts, Node tests use Vitest, and the published JavaScript paths stay unchanged. The original engine changes are preserved.

Local lint, formatting, Node and packed-package checks pass, with the documented expected failures retained. All 41 WPT pages pass against both generated builds.

Change

Extract legacy DOM handling from #167, preserving its helpers, host fixture, and regression assertions in one focused change.

This needs integration with #190 and #193. Their :disabled, :enabled, and :defined reference assertions remain as three explicit expected failures. They fail against current master too; the extraction does not hide them behind a same-engine reference.

Legacy mode selects helper-backed attribute reads, collection filtering, element traversal fallbacks, and compiler read tables. Mode changes invalidate compiled resolvers and query plans. Document changes recheck URL reads and preserve the flag. Modern mode retains direct traversal and uses the shared runtime initialization merged in #197.

The extraction also corrects an archive bug: the generated-code rewrite must not replace host-read-looking text inside selector strings. :not([data-x="e.localName"]) now retains its literal value. Dedicated coverage protects this boundary.

This does not claim to transpile JavaScript, polyfill the runtime, or make modern browser state available in old hosts. It excludes the separate property-read optimization in #194, parser changes, media/time changes, matcher reentry handling, and query-routing optimizations. Reconcile #194's class/id reads and #178's context shortcut when combining those PRs.

Validation with Node 26.5.0 and jsdom 30.0.1: 29 passing legacy tests, 3 expected dependency failures, and all 4 shared-runtime tests pass. The Node-only configuration requires no WPT checkout, web server, or browser download. Historical browsers were not run.

The archived legacy.spec.mts and the legacy integration test from jsdom.spec.mts are retained. Documentation now describes this extraction's boundary rather than the aggregate's unrelated optimizations and market-share report.

@jdalton
jdalton force-pushed the feat/legacy-dom branch 2 times, most recently from 81c9493 to 91670d6 Compare September 5, 2026 19:10
@jdalton
jdalton marked this pull request as ready for review September 5, 2026 19:42
@jdalton
jdalton force-pushed the feat/legacy-dom branch 2 times, most recently from 4a9bc0b to b9fa3b7 Compare September 6, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant