fix(spec): a boolean state selector names what the live element reports

clickable, enabled, focused, checked and selected are derived from the
element rather than written by the markup, so matching them as raw
attributes built [clickable="true"] and reached nothing: the keys are
accepted, no unknown-key error fires, and the worked example in
docs/manual/spec-language.md found no element on web and passed having
checked nothing.

Each key is answered by the same function elementHandle derives the fact
with, since no CSS says what any of them says: :focus names the shadow
host of a focused field as well, :checked misses a checked custom
element and answers for a selected option besides, and [checked] is the
state the page loaded with rather than the one the user left it in.
This commit is contained in:
pj committed 2026-08-18 20:43:09 +05:30
1 parent 4bcd82a8a6
commit f7135b81d8
3 files changed
+212 -47

No files matched your search

+5
View File
@@ -50,6 +50,11 @@ export interface FakeElementSpec {
clickable?: boolean;
editable?: boolean;
disabled?: boolean;
// checked/selected are DOM properties rather than markup attributes on a real
// element, which is the whole point of them: the attribute records what the
// page started with and stops tracking the first time a user acts.
checked?: boolean;
selected?: boolean;
// overflows makes the element's content taller than its box, which is how the
// host decides an element is scrollable.
overflows?: boolean;