Add opt-in legacy DOM reads and regression coverage - #203
Open
jdalton wants to merge 1 commit into
Open
Conversation
jdalton
force-pushed
the
feat/legacy-dom
branch
2 times, most recently
from
September 5, 2026 19:10
81c9493 to
91670d6
Compare
jdalton
marked this pull request as ready for review
September 5, 2026 19:42
jdalton
force-pushed
the
feat/legacy-dom
branch
2 times, most recently
from
September 6, 2026 02:30
4a9bc0b to
b9fa3b7
Compare
jdalton
force-pushed
the
feat/legacy-dom
branch
from
September 6, 2026 11:40
b9fa3b7 to
e0345f1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:definedreference 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.mtsand the legacy integration test fromjsdom.spec.mtsare retained. Documentation now describes this extraction's boundary rather than the aggregate's unrelated optimizations and market-share report.