Reuse querySelectorAll for getElementsByTagName - #720
Open
andrewiggins wants to merge 3 commits into
Open
andrewiggins wants to merge 3 commits into
andrewiggins wants to merge 3 commits into
Conversation
andrewiggins
added this pull request to stack #721
September 17, 2026 16:46
This comment has been minimized.
This comment has been minimized.
andrewiggins
force-pushed
the
refactor-getElementsByTagName
branch
from
September 17, 2026 16:53
1d1c378 to
b976a93
Compare
andrewiggins
force-pushed
the
refactor-getElementsByTagName
branch
from
September 17, 2026 18:06
b976a93 to
28673c4
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.
Summary
Builds on #719. This layer contains only the tag-name lookup refactor and its required selector support.
getElementsByTagName()descendant loop with a structured matcher passed toquerySelectorAll().localName.htmlNamerather thanvalue, extending the normalized-name matcher contract and type tests.NodeList, includingitem()access; this does not implement a liveHTMLCollection.This shares traversal and matching code; it is not an overall performance-speedup claim. Earlier synthetic Node/V8 measurements of this approach remained slower than the dedicated loop. Those measurements were not a final-commit or browser benchmark. Plain-array results and scalar matcher experiments are not included.
Validation
htmlName, foreign matching uses the originalname, and neither usesvalue.Stack created with GitHub Stacks CLI • Give Feedback 💬