Invoker API
Description
The Invoker API (the command and commandfor HTML attributes) allows to trigger commands (opening a dialog, showing a popover, etc...) using a <button> in a declarative way.
It is shipped in Chromium-based browsers but not yet in Firefox and Safari
Specification
https://html.spec.whatwg.org/multipage/form-elements.html#dom-button-command
web-feature
invoker-commands
Test Links
html/semantics/the-button-element/command-and-commandfor
html/semantics/popovers/popover-light-dismiss-command
Additional Signals
https://github.com/mozilla/standards-positions/issues/902 https://github.com/WebKit/standards-positions/issues/264
This comment was automatically generated based on the information you provided. Please don't edit it.
Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
If this doesn't accurately correspond to your proposal, please update your initial comment to include web-features: <feature-id>.
To find feature IDs, use the web-features explorer.
Feature Invoker commands
- ID: invoker-commands
- Name: Invoker commands
-
Description: The
commandandcommandforattributes for the<button>HTML element dispatch an action to an element when the button is invoked (by click or keystroke), as a declarative alternative toaddEventListener()calls oronclickattribute handlers. - Baseline status: Limited Availability
- Docs: Invoker Commands API
- More information: See the web-features explorer
This feature is already implemented in Firefox Nightly and Safari Technology Preview so probably does not need to be part of Interop 2026 unless there are known bugs or inconsistencies between browsers.
This feature is already implemented in Firefox Nightly and Safari Technology Preview so probably does not need to be part of Interop 2026.
Looks like both firefox nightly and safari tech preview are both failing tests:
https://wpt.fyi/results/html/semantics?label=master&label=experimental&aligned&q=invoker
Since the feature doesn't have full support, I'd say it should be a part of interop 2026.
Thank you @stof for submitting this proposal! I took the liberty of editing your description to link to wpt.fyi, I hope those are the tests you were intending to point at.
@foolip yes, indeed
Note that tentative tests aren't suitable for Interop, so a better test link is https://wpt.fyi/results/html/semantics/the-button-element/command-and-commandfor?label=master&label=experimental&aligned&q=%21is%3Atentative (if there are tests marked as tentative where there is in fact now agreement on the desired behaviour they need to be updated before the proposals are assessed).
Additional to the tests mentioned in OP there's also:
- html/semantics/popovers/popover-focus-2.html%3Ftest2
- /html/semantics/popovers/popover-focus-3.html
- html/semantics/popovers/popover-focus-4.html
Of the non tentative tests the only ones that will still potentially have partial failures in Safari (once the 227 test runs upload) will be some of these focus ones but it's distinct from the actual command/commandfor and is more related to popovers. It's possible that popover focus behaviour should be an interop proposal on its own,
Firefox similarly might have some failures of this sort but some of them are even in-progress with fixes.
I don't think we should call this "Invoker API". That's a name we moved away from in standards.
The name of the feature in the web-features project is still invoker-commands, which is why I used "Invoker API" when submitting it. I'm fine with any name for that scope though.