Skip to content

build: refresh the HTML attribute tables from the live standards - #877

Merged
JuroOravec merged 2 commits into
mainfrom
build/refresh-html-attribute-tables
Nov 24, 2026
Merged

JuroOravec merged 2 commits into
mainfrom
build/refresh-html-attribute-tables

Conversation

@JuroOravec

Copy link
Copy Markdown
Member

(Sonnet 5.5)

Runs scripts/generate_html_attribute_values.py with network access, so every table and the module header's generation date match the current sources. #867 had hand-edited only the DOM_EVENT_NAMES line because the sources could not be downloaded.

What changed in the tables

The HTML Standard's attribute index now lists a switch attribute for <input>, a boolean attribute that makes a checkbox render as a switch. That is the only table change. The module header now reads "Last Updated 24 November 2026. Generated 2026-11-24".

Table Change
ELEMENT_ATTRIBUTES Added switch to input.
BOOLEAN_ATTRIBUTES Added switch, on input.
HTML_ELEMENTS, ENUMERATED_VALUES, GLOBAL_ATTRIBUTES, CUSTOM_ELEMENT_ATTRIBUTES, ARIA_ATTRIBUTES, SVG_ELEMENTS, OBSOLETE_ELEMENTS, DOM_EVENT_NAMES No name added or removed.

No name was removed from any table, so no check starts reporting something it accepted before, and no security check loses a name.

Which Citry checks read each table:

  • ELEMENT_ATTRIBUTES feeds citry.template.misspelled-attribute (typo suggestions on an element) and citry.template.misspelled-directive (a c-* name that is an attribute of its element is not reported). <c-element> reads the union of all element attributes.
  • BOOLEAN_ATTRIBUTES and ENUMERATED_VALUES feed citry.template.invalid-attribute-value. With switch added, <input type="checkbox" switch="false"> now gets the existing "a boolean attribute is on whenever it is present" warning, because false still turns the switch on. <input switch> and <div switch="false"> get no finding, as before.
  • GLOBAL_ATTRIBUTES and CUSTOM_ELEMENT_ATTRIBUTES feed the same two attribute-name rules.
  • ARIA_ATTRIBUTES feeds citry.template.unknown-aria-attribute.
  • HTML_ELEMENTS, SVG_ELEMENTS and OBSOLETE_ELEMENTS feed citry.template.misspelled-element.
  • DOM_EVENT_NAMES feeds citry.vue.misspelled-event, citry.browser.undeclared-component-event, and the refusal in actions.Dispatch. The browser runtime holds a copy of it in _vue/client.js.

No table changes how a template renders. They feed the citry check lint rules, the language-server support that reads the same tables, and the Dispatch name refusal. The Dispatch refusal reads DOM_EVENT_NAMES, which this PR leaves unchanged.

Event names

DOM_EVENT_NAMES is the same 175 names as on main. The 44 names that #867 added are in SUPPLEMENTAL_EVENT_NAMES in the generator, each group with its spec reference, so a full run keeps them. This run shows it: the generated line is identical to the committed one. The copy in _vue/client.js needed no change, and rebuilding runtime.js with pnpm --dir packages/js/citry-client run build produced the same file.

Other changes

  • A test that the committed event names hold every name in SUPPLEMENTAL_EVENT_NAMES, so a refresh or an edit to the list cannot drop a name that Dispatch refuses without a failing test.
  • A test that the tables know switch, and one that the attribute-value rule reads it as a boolean attribute of input only.
  • A changelog line under v1.3.0 "Added". Both rule_invalid_attribute_value and rule_misspelled_attribute are errors by default, so <input switch="false"> and a typo such as <input swich> now fail citry check where they passed on 1.2.0.
  • docs/codebase.md ("Refreshing the HTML tables") now lists the Dispatch refusal among the readers of the event names, and says the script copies them into client.js, that the runtime must be rebuilt after a run, and that a hand-added event name goes in SUPPLEMENTAL_EVENT_NAMES. fix(events): refuse standard DOM event names in Dispatch and in the browser #867 added the copy but not these steps.

Not changed

  • The Vue types the generator reads are the copy committed with the language server (@vue/runtime-dom 3.5.44). The script does not download them, so their event names are unchanged.

Versioning

Touches nothing the 1.x promise covers: no public API, format or default changes, and no table loses a name. The new citry check findings apply to switch only and are a table addition to two existing rules, not a new rule. The versioning page already lets a minor release make a CI job fail this way, and each rule's severity is configurable.

Left for the maintainer

Adding switch to BOOLEAN_ATTRIBUTES makes one piece of existing advice wrong. For a bound string such as :switch="'false'", invalid-attribute-value says to bind a JavaScript boolean, :switch="false". Vue's client renderer writes switch="false" for that in Chromium and Firefox, and Citry's server renderer does too, because switch is not in Vue's own boolean list. The advice is also wrong for six names already in the table (alpha, headingreset and the four shadowroot*). I kept the refresh as the generator wrote it, and #876 tracks the fix, with the browser check, for 1.4.0.

Checks

  • test_events_dispatch_names.py (the sync test between the Python table and the client.js copy), test_html_attribute_values.py, and the lint and analysis suites (test_markup_lint.py, test_analysis.py, test_browser_analysis.py, test_check.py, test_diagnostics.py, test_linting_info_validation.py, test_events_actions.py, test_component_like.py): 1,041 passed.
  • ruff check, ruff format --check and mypy (also with --platform linux) on the touched files, and scripts/validate.py: pass.

🤖 Generated with Claude Code

JuroOravec and others added 2 commits November 24, 2026 23:52
Run scripts/generate_html_attribute_values.py with network access so every
table and the module header's generation date match the current sources. The
only table change is the HTML Standard's new `switch` attribute of `input`, a
boolean attribute. DOM_EVENT_NAMES is unchanged: the 44 names added in #867
live in SUPPLEMENTAL_EVENT_NAMES in the script, and a full run keeps all 175.

Add tests for `switch` and for the script's hand-added event names, and
document the script's copy of the event names in client.js.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both rules that read the new `switch` entry are errors by default, so a
template with `switch="false"` or a typo of `switch` now fails `citry check`.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@JuroOravec
JuroOravec merged commit 3ef3924 into main Nov 24, 2026
34 checks passed
@JuroOravec
JuroOravec deleted the build/refresh-html-attribute-tables branch November 24, 2026 23:38
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.

1 participant