Compare exact case-sensitive attribute values directly - #200
Merged
Conversation
jdalton
force-pushed
the
perf/attribute-equality
branch
2 times, most recently
from
September 6, 2026 02:30
aeda16b to
b7d8726
Compare
jdalton
force-pushed
the
perf/attribute-equality
branch
from
September 6, 2026 11:40
b7d8726 to
c42d2ee
Compare
Collaborator
Author
|
Integrated the current legacy helpers and added WPT coverage for exact values, escapes, HTML/XML case rules, SVG, and custom operators. A new cross-document test exposed cached HTML case rules being reused for XML; the PR now invalidates document-specific plans when the document changes. All 470 Node tests and 52 WPT pages pass, and CI is green. Coverage thresholds are unchanged. |
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. All 41 WPT pages pass against both generated builds.
Change
Compare exact, case-sensitive attribute values as strings instead of running a regular expression for each candidate. Case-insensitive matches and other operators keep their existing path.
Extracted from #167 without its legacy helpers or tag-ordering changes. The attribute name stays separate from the decoded value, fixing the aggregate's case-rule regression. Quoted values retain JavaScript escapes without double-escaping quotes.
Validation covers HTML case-insensitive attributes, custom data attributes, explicit
i, empty and missing attributes, escaped values, XML, SVG, cached queries, and a custom operator. Compilation checks confirm the direct comparison is emitted. All three tests pass with Chromium enabled, including ten native-browser comparisons.Run with Node.js ≥ 22. Commands are in
test/attribute-equality.md. No end-to-end speedup is claimed without a benchmark.