Skip to content

test(html): cover the tables no corpus reaches - #22058

Merged
alexander-akait merged 3 commits into
webpack:mainfrom
aryanraj45:test/html-table-coverage
Sep 12, 2026
Merged

alexander-akait merged 3 commits into
webpack:mainfrom
aryanraj45:test/html-table-coverage

Conversation

@aryanraj45

@aryanraj45 aryanraj45 commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Measured every lookup table in lib/html/data.js against configCases, wpt and the framework corpus the tool comparisons install: 21 tables held names nothing spelled, so those branches were reached by no fixture. Seven cases take 24 tables further and 15 to full. EVENT_HANDLER_ATTRIBUTES goes from 5/94 to full, each handler written on an element the table allows it on, so a wrong binding fails rather than declining quietly. The rest close the tree-construction tables marquee and the ruby elements are the only names in (SPECIAL, HTML_SCOPE, IMPLIED, SCOPE_ENDED_BY, the optional-end-tag pair), the attribute rewrite tables, both quirks-mode public identifiers, and the reserved SVG names.

Two cases pin what must not change: autocomplete names autofill on an input, where it enumerates on a form, so only the second folds.

What kind of change does this PR introduce?

test — it adds configCases/ only, no lib/ change.

Did you add tests for your changes?

This is the tests. Seven cases under test/configCases/html/: marquee-scope, ruby-annotations, event-handler-attributes, attribute-tables, quirky-doctype-w3o, quirky-doctype-w3c, foreign-reserved-names.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

n/a

Use of AI

Claude Code was used, driven by me, for three things: walking the data tables against each corpus to find which names no fixture spells, writing the fixtures and cases, and running the suites. Every finding it reported was re-checked against the spec before it went in — three suspected defects (ruby end-tag omission, enumerated folding, autocomplete) turned out to be correct behaviour with the fixture at fault, and the autocomplete one is now pinned as a case. No lib/ code was changed.

Summary by CodeRabbit

  • Bug Fixes
    • Improved HTML minification for token-list attributes by preserving repeated values where duplicates are meaningful and deduplicating attributes that require unique tokens.
  • Tests
    • Added coverage for complex and boolean attributes, event handlers, SVG reserved names, marquee content, ruby annotations, and quirks-mode doctypes.
    • Added snapshot validation for generated HTML across varied elements, inline events, unusual casing, whitespace, and legacy markup.

Measured every lookup table in lib/html/data.js against configCases, wpt
and the framework corpus: 21 held names nothing spelled. Seven cases take
24 tables further and 15 to full, EVENT_HANDLER_ATTRIBUTES from 5/94 among
them, each handler on an element the table allows so a wrong binding fails
rather than declines quietly. Two pin what must not fold: autocomplete
names autofill on an input where it enumerates on a form.
@changeset-bot

changeset-bot Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1ae8c74

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 9672f663-9b10-4607-a3c6-7d282c28924e

📥 Commits

Reviewing files that changed from the base of the PR and between 35a3353 and 1ae8c74.

⛔ Files ignored due to path filters (2)
  • test/configCases/html/attribute-tables/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/html/attribute-tables/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing (2)
  • test/configCases/html/attribute-tables/page.html
  • test/helpers/syntaxEquivalence.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The PR adds HTML minification coverage for attribute normalization, event handlers, foreign names, marquee scope, quirks-mode doctypes, and ruby annotations. It also updates token-list equivalence handling for duplicate tokens.

HTML Minification Cases

Layer / File(s) Summary
Token-list equivalence handling
test/helpers/syntaxEquivalence.js
Limits token deduplication to itemprop, itemref, and itemtype. Repeated tokens remain for accesskey, headers, and ping.
Attribute normalization case
test/configCases/html/attribute-tables/*
Adds mixed-format attribute fixtures and enables attribute normalization, boolean collapsing, and token-list sorting.
Event-handler minification case
test/configCases/html/event-handler-attributes/*
Adds inline handlers for many event types and snapshots the extracted, minimized HTML.
HTML scope and foreign names
test/configCases/html/foreign-reserved-names/*, test/configCases/html/marquee-scope/*
Adds SVG foreign-name and marquee-scope fixtures with extraction, minimization, and snapshot checks.
Quirks-mode doctype cases
test/configCases/html/quirky-doctype-w3c/*, test/configCases/html/quirky-doctype-w3o/*
Adds legacy doctypes and malformed table markup for quirks-mode output coverage.
Ruby annotation case
test/configCases/html/ruby-annotations/*
Adds ruby, rb, rp, rt, and rtc markup for HTML minification snapshot coverage.

Suggested reviewers: alexander-akait

Priority: ⬇️ Low

Change: Other

Merge Risk: ⚪ Minimal · up to 1ae8c

The PR adds test coverage without changing library behavior, and no merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title uses valid Conventional Commit syntax with the allowed type test and optional scope html. It accurately describes the HTML test coverage changes. The branch prefix is not provided, so th… Provide the branch name or confirm that its prefix is test.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title uses valid Conventional Commit syntax with the allowed type test and optional scope html. It accurately describes the HTML test coverage changes. The branch prefix is not provided, so the required type-to-branch-prefix match cannot be verified.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aryanraj45 aryanraj45 changed the title test(html): drive every event handler, and the tables only marquee and ruby reach test(html): cover the tables no corpus reaches Sep 11, 2026
@codecov

codecov Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.97%. Comparing base (3a69d29) to head (1ae8c74).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #22058   +/-   ##
=======================================
  Coverage   94.97%   94.97%           
=======================================
  Files         726      726           
  Lines       97275    97275           
  Branches    29629    29629           
=======================================
+ Hits        92386    92389    +3     
+ Misses       4889     4886    -3     
Flag Coverage Δ
css-parsing 24.02% <ø> (ø)
html5lib 27.24% <ø> (ø)
integration 87.51% <ø> (+0.02%) ⬆️
syntax-equivalence 78.25% <ø> (ø)
test262 44.83% <ø> (ø)
unit 60.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The new attribute case put a repeat and extra whitespace in `accesskey`
and `itemref`, and the equivalence check called the minified page a
different DOM: it read neither as a list, and it sorted the lists it did
read without dropping a repeat. Both are sets of unique tokens in the
spec, so a repeat names nothing the first did not. `ping` stays as
written, where the spec lists URLs rather than a set.
@codspeed

codspeed Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 88.29%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
✅ 390 untouched benchmarks
⏩ 6 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Memory benchmark "side-effects-reexport", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 454.1 KB 167.8 KB ×2.7
⚡ Memory benchmark "concatenate-modules", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 2.6 MB 1 MB ×2.6
⚡ Memory benchmark "no-minimize", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' 902.7 KB 625.9 KB +44.21%
⚡ Memory unit benchmark "js-parser-unit", source 'react.development.js' 740.1 KB 600.2 KB +23.3%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing aryanraj45:test/html-table-coverage (1ae8c74) with main (3a69d29)

Open in CodSpeed

Footnotes

  1. 6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

…e reads

The set the harness folds a repeat out of was written from the spec calling
a list unique, which is a wider line than the printer's: it drops a repeat
only where the list reflects as a DOMTokenList, leaving `headers` and
`accesskey` as the strings they reflect as. Folding those here hid the
difference. The case now carries a repeat in all six lists, where it drove
two.
@alexander-akait
alexander-akait merged commit e142eea into webpack:main Sep 12, 2026
63 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview is available (e142eea).

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@e142eea
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@e142eea
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@e142eea

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.

2 participants