Conversation
Check the tag before matching the fixed input and default ignore selectors. Keep the existing selector checks for candidate tags and custom options. Co-Authored-By: Codex <noreply@openai.com>
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d8fdfc3:
|
Avoid intermediate arrays when collecting direct text nodes. Iterate childNodes and append Text.data while preserving whitespace and excluding descendants. Co-Authored-By: Codex <noreply@openai.com>
scttcper
marked this pull request as ready for review
September 17, 2026 06:23
This branch has not been deployed
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.
Skip selector matching when an element's tag rules out a match, and collect direct text nodes in one pass. Keep the existing selector checks for candidate tags and custom ignore options.
Combined changes vs upstream on a 1,002-element fixture, median of nine paired batches:
matches()calls drop from 2,005 to 201 per query. These are synthetic query timings, not whole-suite gains. The input-only and script/style-only cases still regress in some environments, up to 10.7%.Full evidence and runner: 78 benchmark cases, 73,012 behavior comparisons with no differences. Node stayed at 24.14, below jsdom 30.1's declared 24.15 minimum.