Skip to content

js+css: implement HTMLInputElement.indeterminate and :indeterminate - #238

Merged
tannevaled merged 1 commit into
mainfrom
html-input-indeterminate
Sep 28, 2026
Merged

tannevaled merged 1 commit into
mainfrom
html-input-indeterminate

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

  • Unlike checked, indeterminate has NO backing content attribute at all (HTML Standard §4.10.5.1.19) — pure script-set runtime state.
  • Added dom.Node.Indeterminate (the same shape as the existing Quirks/Shadow runtime-only fields, not Attr), a JS accessor that reads/writes it directly (not via setAttr/removeAttr), and a new :indeterminate CSS pseudo-class wired into the same four sites :disabled already uses (Matches, the parser switch, the specificity count, the bare-compound-is-non-empty check).
  • Found by sweeping a genuinely fresh corpus page (github.com's own homepage bundles — behaviors.js/element-registry.js/environment.js) after the existing ten-page corpus stopped turning up new gaps. Real usage: github.com's own behaviors.js sets checkbox.indeterminate = true on page load for its "select all" bulk-action tri-state checkboxes.
  • Deliberately left out of scope, disclosed honestly: this engine's own checkbox painter (paint.paintCheckboxLike) already approximates checked as a plain accent-coloured fill with no checkmark glyph — a visually distinct indeterminate mark would mean inventing new iconography beyond what checked itself has. This round only fixes script/author-CSS correctness, not this engine's own default checkbox appearance.

Test plan

  • Two new tests, git-stash-confirmed as a go vet COMPILE failure (the strongest class): css/selector_test.go's TestIndeterminatePseudo (mirrors TestCheckedPseudo/TestDisabledEnabledPseudo) and js/js_test.go's TestIndeterminateAccessor (confirms setting it does NOT touch getAttribute('indeterminate'), unlike every other boolean accessor on this element).
  • go build ./... && go vet ./... && go test ./... clean.
  • Coverage floors held (css 99.5%, layout 100%, paint 100%, dom 98.4%, paginate 100%).
  • Bench vs. real headless Chrome: exactly flat/within already-documented noise across all ten pages, including github.com/golang/go itself (0.638, unchanged) — expected, pure JS/CSS-correctness change with no paint-visible effect by design.

🤖 Generated with Claude Code

Unlike checked, indeterminate has no backing content attribute at all
(HTML Standard 4.10.5.1.19) -- pure script-set runtime state. Added
dom.Node.Indeterminate (the same shape as the existing Quirks/Shadow
runtime-only fields), a JS accessor that reads/writes it directly
(not via setAttr/removeAttr), and a new :indeterminate CSS
pseudo-class wired into the same four sites :disabled already uses.

Found sweeping a fresh corpus page (github.com's own homepage
bundles) after the existing ten-page corpus stopped turning up new
gaps. Real usage: github.com's own behaviors.js sets
checkbox.indeterminate = true on load for its "select all"
bulk-action tri-state checkboxes.

Deliberately out of scope: this engine's own checkbox painter already
approximates `checked` as a plain accent-coloured fill with no
checkmark glyph, so a visually distinct indeterminate mark would mean
inventing new iconography beyond what checked itself has. This round
only fixes script/author-CSS correctness, not default appearance.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit a67cbe5 into main Sep 28, 2026
7 checks passed
@tannevaled
tannevaled deleted the html-input-indeterminate branch September 28, 2026 06:27
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