Intent to Ship: ToggleEvent source attribute

198 views
Skip to first unread message

Joey Arhar

unread,
Jul 21, 2025, 4:04:01 PMJul 21
to blink-dev

Contact emails

jar...@chromium.org

Explainer

None

Specification

https://html.spec.whatwg.org/multipage/interaction.html#the-toggleevent-interface
https://github.com/whatwg/html/pull/11186

Summary

The source attribute of ToggleEvents contains the element which triggered the ToggleEvent to be fired, if applicable. For example, if a button element with the popovertarget or commandfor attribute set up to open a popover is clicked by the user, then the ToggleEvent fired on the popover will have its source attribute set to the invoking button.



Blink component

Blink>DOM

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

I believe that the interop and compat risk is low because the spec is merged, we have positive standards positions, and everything is tested in WPT.



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/1220)

WebKit: Support (https://github.com/WebKit/standards-positions/issues/494)

Web developers: No signals

Other signals:

Ergonomics

This will frequently be used in tandem with popovers and command invokers. The default usage of this API will not make it hard for chrome to maintain good performance.



Activation

This feature will not be hard for developers to use immediately as-is. There is an open MDN issue to add documentation for this: https://github.com/mdn/content/issues/39723



Security

I don't think there are any security risks for this feature.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

There is no special DevTools support that is needed for this feature.



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

Yes

https://wpt.fyi/results/html/semantics/popovers/popover-toggle-source.html https://wpt.fyi/results/html/semantics/interactive-elements/the-dialog-element/dialog-toggle-source.html https://wpt.fyi/results/html/semantics/interactive-elements/the-details-element/details-toggle-source.html



Flag name on about://flags

ToggleEventSource

Finch feature name

ToggleEventSource

Rollout plan

Will ship enabled for all users

Requires code in //chrome?

False

Measurement

I haven't added UseCounters for this feature, but I could if anyone is interested in doing so.

Estimated milestones

Shipping on desktop140
Shipping on Android140
Shipping on WebView140


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

The retargeting behavior of this attribute when and invoker is in a shadow root is under discussion, but I strongly believe that this is an edge case which we can modify the behavior of after shipping: https://github.com/whatwg/html/pull/11345

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5165304401100800?gate=5088912435052544

This intent message was generated by Chrome Platform Status.

Dan Clark

unread,
Jul 21, 2025, 8:27:47 PMJul 21
to blink-dev, jar...@chromium.org
LGTM1

Alex Russell

unread,
Jul 22, 2025, 6:14:50 AMJul 22
to blink-dev, dan...@microsoft.com, Joey Arhar
LGTM2 on the condition that some sort of minimal explainer that includes at least example code outlining the problem and how this change fixes it is produced.

Best,

Alex

Domenic Denicola

unread,
Jul 22, 2025, 10:16:11 PMJul 22
to Alex Russell, blink-dev, dan...@microsoft.com, Joey Arhar
LGTM3, but I also believe a small explainer is a good idea.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/029c3ed2-bcb3-4c7c-b2f6-6089a121d7d5n%40chromium.org.

Joey Arhar

unread,
Jul 23, 2025, 12:12:46 PMJul 23
to Domenic Denicola, Alex Russell, blink-dev, dan...@microsoft.com

Alex Russell

unread,
Jul 23, 2025, 12:28:03 PMJul 23
to Joey Arhar, Domenic Denicola, blink-dev, dan...@microsoft.com
Thanks for this. LGTM++
Reply all
Reply to author
Forward
0 new messages