Repository navigation
build: refresh the HTML attribute tables from the live standards - #877
Merged
Merged
Conversation
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>
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.
(Sonnet 5.5)
Runs
scripts/generate_html_attribute_values.pywith network access, so every table and the module header's generation date match the current sources. #867 had hand-edited only theDOM_EVENT_NAMESline because the sources could not be downloaded.What changed in the tables
The HTML Standard's attribute index now lists a
switchattribute 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".ELEMENT_ATTRIBUTESswitchtoinput.BOOLEAN_ATTRIBUTESswitch, oninput.HTML_ELEMENTS,ENUMERATED_VALUES,GLOBAL_ATTRIBUTES,CUSTOM_ELEMENT_ATTRIBUTES,ARIA_ATTRIBUTES,SVG_ELEMENTS,OBSOLETE_ELEMENTS,DOM_EVENT_NAMESNo 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_ATTRIBUTESfeedscitry.template.misspelled-attribute(typo suggestions on an element) andcitry.template.misspelled-directive(ac-*name that is an attribute of its element is not reported).<c-element>reads the union of all element attributes.BOOLEAN_ATTRIBUTESandENUMERATED_VALUESfeedcitry.template.invalid-attribute-value. Withswitchadded,<input type="checkbox" switch="false">now gets the existing "a boolean attribute is on whenever it is present" warning, becausefalsestill turns the switch on.<input switch>and<div switch="false">get no finding, as before.GLOBAL_ATTRIBUTESandCUSTOM_ELEMENT_ATTRIBUTESfeed the same two attribute-name rules.ARIA_ATTRIBUTESfeedscitry.template.unknown-aria-attribute.HTML_ELEMENTS,SVG_ELEMENTSandOBSOLETE_ELEMENTSfeedcitry.template.misspelled-element.DOM_EVENT_NAMESfeedscitry.vue.misspelled-event,citry.browser.undeclared-component-event, and the refusal inactions.Dispatch. The browser runtime holds a copy of it in_vue/client.js.No table changes how a template renders. They feed the
citry checklint rules, the language-server support that reads the same tables, and theDispatchname refusal. TheDispatchrefusal readsDOM_EVENT_NAMES, which this PR leaves unchanged.Event names
DOM_EVENT_NAMESis the same 175 names as onmain. The 44 names that #867 added are inSUPPLEMENTAL_EVENT_NAMESin 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.jsneeded no change, and rebuildingruntime.jswithpnpm --dir packages/js/citry-client run buildproduced the same file.Other changes
SUPPLEMENTAL_EVENT_NAMES, so a refresh or an edit to the list cannot drop a name thatDispatchrefuses without a failing test.switch, and one that the attribute-value rule reads it as a boolean attribute ofinputonly.rule_invalid_attribute_valueandrule_misspelled_attributeare errors by default, so<input switch="false">and a typo such as<input swich>now failcitry checkwhere they passed on 1.2.0.docs/codebase.md("Refreshing the HTML tables") now lists theDispatchrefusal among the readers of the event names, and says the script copies them intoclient.js, that the runtime must be rebuilt after a run, and that a hand-added event name goes inSUPPLEMENTAL_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
@vue/runtime-dom3.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 checkfindings apply toswitchonly 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
switchtoBOOLEAN_ATTRIBUTESmakes one piece of existing advice wrong. For a bound string such as:switch="'false'",invalid-attribute-valuesays to bind a JavaScript boolean,:switch="false". Vue's client renderer writesswitch="false"for that in Chromium and Firefox, and Citry's server renderer does too, becauseswitchis not in Vue's own boolean list. The advice is also wrong for six names already in the table (alpha,headingresetand the fourshadowroot*). 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 theclient.jscopy),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 --checkandmypy(also with--platform linux) on the touched files, andscripts/validate.py: pass.🤖 Generated with Claude Code