js+css: implement HTMLInputElement.indeterminate and :indeterminate - #238
Merged
Merged
Conversation
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>
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.
Summary
checked,indeterminatehas NO backing content attribute at all (HTML Standard §4.10.5.1.19) — pure script-set runtime state.dom.Node.Indeterminate(the same shape as the existingQuirks/Shadowruntime-only fields, notAttr), a JS accessor that reads/writes it directly (not viasetAttr/removeAttr), and a new:indeterminateCSS pseudo-class wired into the same four sites:disabledalready uses (Matches, the parser switch, the specificity count, the bare-compound-is-non-empty check).behaviors.js/element-registry.js/environment.js) after the existing ten-page corpus stopped turning up new gaps. Real usage: github.com's ownbehaviors.jssetscheckbox.indeterminate = trueon page load for its "select all" bulk-action tri-state checkboxes.paint.paintCheckboxLike) already approximatescheckedas a plain accent-coloured fill with no checkmark glyph — a visually distinct indeterminate mark would mean inventing new iconography beyond whatcheckeditself has. This round only fixes script/author-CSS correctness, not this engine's own default checkbox appearance.Test plan
go vetCOMPILE failure (the strongest class):css/selector_test.go'sTestIndeterminatePseudo(mirrorsTestCheckedPseudo/TestDisabledEnabledPseudo) andjs/js_test.go'sTestIndeterminateAccessor(confirms setting it does NOT touchgetAttribute('indeterminate'), unlike every other boolean accessor on this element).go build ./... && go vet ./... && go test ./...clean.🤖 Generated with Claude Code