Skip to content

[focusgroup] Switch to token list, allow behavior tokens to not be the first token - #1450

Merged
lukewarlow merged 6 commits into
openui:mainfrom
janewman:focusgroup-explainer-sync
May 26, 2026
Merged

lukewarlow merged 6 commits into
openui:mainfrom
janewman:focusgroup-explainer-sync

Conversation

@janewman

@janewman janewman commented May 26, 2026 •

Copy link
Copy Markdown
Collaborator

Updates the following to match the latest iteration of whatwg/html#11723

  • The focusgroup attribute is now a token list instead of a string.
  • Focusgroup tokens are allowed to be put in any order, with the first valid behavior applied.

janewman added 6 commits May 22, 2026 04:00
Aligns the explainer's Feature detection section with the IDL
landed in whatwg/html#11723: focusGroup as a DOMTokenList and
focusGroupStart as a boolean, both on the HTMLOrSVGElement mixin.
Adds a short DOMTokenList ergonomics example so authors know they can
use .add/.toggle/.contains/.remove rather than parsing the attribute
value. Links the WHATWG PR from the intro metadata and refreshes the
Last updated date.
Customs review iteration 1: prose at line 837 referred to a
`focusgroup` property (lowercase) but the IDL the previous commit
introduced declares `focusGroup` (camelCase) and adds a separate
`focusGroupStart` boolean. Rewrites the sentence to name both IDL
properties correctly and distinguish them from the content-attribute
names. Adds one bridging sentence noting that direct string
assignment continues to work alongside the DOMTokenList methods.
Customs review iteration 2: RR1 (spec-accuracy) and RR3 (prose-voice)
independently flagged "still works" as conversational and as assuming
the reader knew the prior DOMString IDL. Rewrites the sentence in the
spec-adjacent register used by the rest of the section.
Drops the per-token API discussion (Because focusGroup is a DOMTokenList...
plus the JS example) and the readonly/PutForwards string-assignment note.
Both patterns are well known to authors who reach for the IDL, and removing
them keeps the Feature detection section focused on the new IDL surface.
Token order in the focusgroup attribute is not significant per the spec
PR algorithm — only the SET of tokens matters. The explainer previously
implied an order requirement in several places (mostly via "first token"
phrasings used to mean "the behavior token"). Replaces those with
"behavior token" where the meaning was semantic, drops the explicit
"Order: first token MUST be ..." claim in the Index of focusgroup
values, softens the Authoring guidance "Put the behavior token first"
imperative to a readability recommendation, and notes "in any order" in
the Focusgroup tokens introduction.
The bracket notation immediately after the intro sentence shows tokens
in a conventional order (behavior, axis, wrap, memory); the rewritten
intro labels that order as conventional and explicitly states any
order is valid.
@janewman
janewman marked this pull request as ready for review May 26, 2026 17:30
@lukewarlow
lukewarlow merged commit 36051e5 into openui:main May 26, 2026
3 checks passed
@janewman

Copy link
Copy Markdown
Collaborator Author

@lukewarlow thanks for the quick review!

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.

2 participants