Skip to content

Implement NodeIterator for DOM traversal - #127

Merged
wieslawsoltes merged 1 commit into
mainfrom
feature/node-iterator
Sep 16, 2026
Merged

wieslawsoltes merged 1 commit into
mainfrom
feature/node-iterator

Conversation

@wieslawsoltes

@wieslawsoltes wieslawsoltes commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and change

DOMPurify captures Document.prototype.createNodeIterator; its absence blocked unchanged Code OSS chat rendering.

This change adds root-bounded document-order NodeIterator traversal, lazy filter and mask semantics, forward/backward state, mutation coverage, a DOMPurify-shaped native contract, an unchanged hash-pinned WPT, and a bounded 50,000-node linear performance gate.

Closes #82. Equivalent runtime and test changes remain in draft consolidation PR #76.

Validation

  • One focused implementation commit on current main at 8baff8ae; exact head a459e0fd
  • Release V8 native engine build
  • Focused node-iterator contract: 10/10 local passes; warm runs 48-51 ms
  • Required dom-treewalker-nodefilter-focus-navigation profile: 1/1 document, 6/6 subtests
  • Required unchanged NodeIterator-removal-during-filtering WPT: 1/1 document, 4/4 subtests
  • git diff --check

Native GitHub stack #158

  1. Implement NodeIterator for DOM traversal #127 — current implementation layer — NodeIterator (Implement NodeIterator for DOMPurify and Code OSS chat rendering #82)
  2. Isolate the NodeIterator stress fixture #129 — cumulative top — isolated scaling and memory gate (Isolate 50k NodeIterator stress fixture from Windows PartitionAlloc suite state #85)

Only the cumulative top PR receives remote validation. Merge both layers atomically through Stack #158 after the top related check passes.

@wieslawsoltes
wieslawsoltes force-pushed the feature/node-iterator branch 3 times, most recently from d20e6a9 to 881c8f6 Compare September 16, 2026 10:05
@wieslawsoltes
wieslawsoltes changed the base branch from review/code-oss-node-iterator-base to main September 16, 2026 10:20
@wieslawsoltes
wieslawsoltes marked this pull request as ready for review September 16, 2026 20:21
@wieslawsoltes
wieslawsoltes merged commit 5e1be23 into main Sep 16, 2026
9 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement NodeIterator for DOMPurify and Code OSS chat rendering

1 participant