Address WHATNOT 2025 feedback on Platform-Provided Behaviors#1318
Open
anaskim wants to merge 3 commits into
Open
Address WHATNOT 2025 feedback on Platform-Provided Behaviors#1318anaskim wants to merge 3 commits into
anaskim wants to merge 3 commits into
Conversation
added 2 commits
May 8, 2026 15:34
Update the Platform-Provided Behaviors explainer in response to the WHATNOT 2025 discussion and the related issues whatwg/html#11061 and WICG/webcomponents#814. - Restructure the "Prior community feedback" section. Lead with the two most substantive threads (MicrosoftEdge#814 and #11061), pair each piece of feedback with the specific design choice that responds to it, and expand the reply to whatwg/html#11061 comment 3213526709: stay within the existing ElementInternals decomposition pattern used by form-associated custom elements and ARIAMixin, present `behaviors` as a list (not a singular `type` string) so an element can remix multiple behaviors, keep `static formAssociated = true` so inheritance still works, and scope the behavior to form submission only. - Add a "Behaviors are not opaque tokens" subsection that responds to the obscurity criticism: each behavior maps to a single existing native pattern, is fully specified in terms of existing HTML algorithms, and its individual defaults can be overridden via primitives. - Refine Alternative 7 (Low-level primitives on `ElementInternals`) with a layering example showing how `HTMLSubmitButtonBehavior` would compose with concrete primitive overrides if those were available, including a four-state `internals.focusable` enum from WICG/webcomponents#762 and a `keyboardActivation` primitive. The example argues why the smaller primitives cannot ship in isolation yet without risking accessibility and form-submission correctness. - Drop "bundle"/"bundling"/"bundled" wording where it described `HTMLSubmitButtonBehavior` in our own voice; keep it where the word is itself the criticism being summarized. - Drop the stale "Status of the original WICG issue" and "ARIA Working Group" subsections; their content is captured in the rewritten feedback section.
75e56ea to
4f59759
Compare
dandclark
approved these changes
May 13, 2026
| - Activation ordering: Form submission runs as part of the [activation behavior](https://dom.spec.whatwg.org/#eventtarget-activation-behavior), which interacts with the `click` event in a specific order with respect to `preventDefault`. Authors hand-wiring a `click` listener get this ordering wrong in subtle ways. | ||
| - Future-proofing: When HTML adds a new requirement to submit buttons (a new IDL attribute, a new constraint-validation hook, a new accessibility computation), web authors have to discover and re-wire each addition. | ||
|
|
||
| The behavior and primitive layers can also be used together. If low-level primitives were to ship on `ElementInternals` alongside this proposal, an author who wants the full submission capabilities but needs to deviate from one default does not have to reimplement everything: they attach `HTMLSubmitButtonBehavior` for the form submission semantics and then override the specific primitive they care about. |
Member
There was a problem hiding this comment.
IMO this paragraph and the example following it aren't necessary. You already made this point above (starting with "Platform-provided behaviors does not reject primitives...").
Member
Author
There was a problem hiding this comment.
Cut the paragraph. Kept the example since folks at WHATNOT asked to see how HTMLSubmitButtonBehavior would layer with primitive overrides, and trimmed the intro.
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.
Update the Platform-Provided Behaviors explainer in response to the WHATNOT 5/7
ElementInternals) with an example showing howHTMLSubmitButtonBehaviorwould compose with concrete primitive overrides if those were available.elementInternals.typewhatwg/html#11061. Stated how this proposal addresses mentioned concerns with prior iterations.