Intent to Ship: Add onbeforeinput global event handler content attribute

117 views
Skip to first unread message

Mason Freed

unread,
Jul 7, 2022, 4:18:01 PM7/7/22
to blink-dev

Contact emails

mas...@chromium.org

Explainer

https://github.com/whatwg/html/pull/7992

Specification

https://html.spec.whatwg.org/#handler-onbeforeinput

Summary

The 'beforeinput' event fires when the value of an <input>, <textarea>, or contenteditable element is about to be modified. Add an 'onbeforeinput' global content attribute to make it easier for developers to use.



Blink component

Blink>DOM

Search tags

beforeinput

TAG review



TAG review status

Not applicable

Risks



Interoperability and Compatibility

This is shipped in both WebKit and Gecko, and the spec has landed. The only interop risk is thus Chromium *not* shipping it. It is the addition of a new content attribute starting with "on", so compat issues should be negligible.



Gecko: Shipped/Shipping (https://bugzilla.mozilla.org/show_bug.cgi?id=970802)

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=163021)

Web developers: Positive

Other signals:

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?



Debuggability

Content attributes can be seen in devtools.



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

Yes

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

Yes

Flag name



Requires code in //chrome?

False

Tracking bug

https://crbug.com/947408

Estimated milestones

No milestones specified



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).



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6627326972919808

This intent message was generated by Chrome Platform Status.

Frédéric Wang

unread,
Jul 7, 2022, 9:58:53 PM7/7/22
to blin...@chromium.org
On 07/07/2022 22:17, Mason Freed wrote:

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

Yes

H Mason,

Do you have any patch pending to update wpt/interfaces/html.idl?

This is used in some generic tests for global event handlers e.g.

html/webappapis/scripting/events/event-handler-all-global-events.html
mathml/relations/html5-tree/math-global-event-handlers.tentative.html

-- 
Frédéric Wang

Mike Taylor

unread,
Jul 8, 2022, 9:20:21 AM7/8/22
to Mason Freed, blink-dev
LGTM1.
--
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 on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM%3DNeDhHadE97vZtPrAEo6dt_YJbXv3Oq%2BHMHe4eHQp7Lc_Zug%40mail.gmail.com.


Yoav Weiss

unread,
Jul 8, 2022, 9:59:59 AM7/8/22
to Mike Taylor, Mason Freed, blink-dev
LGTM2 % an answer to fwang@'s question

Mason Freed

unread,
Jul 8, 2022, 12:25:25 PM7/8/22
to blink-dev, fw...@igalia.com
On Thursday, July 7, 2022 at 6:58:53 PM UTC-7 fw...@igalia.com wrote:
On 07/07/2022 22:17, Mason Freed wrote:

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

Yes

H Mason,

Do you have any patch pending to update wpt/interfaces/html.idl?

Thanks for the question. My understanding of html.idl (see the top of the file) is that it gets autogenerated based on landed specs. And I would have thought that since the spec now contains `beforeinput` in this section, that would be enough. However, since that landed about a month ago, seems like not. Let me know if you know the proper way to kick webref to do this, and I'm happy to do it.

Thanks,
Mason

Mason Freed

unread,
Jul 8, 2022, 12:28:27 PM7/8/22
to blink-dev, Mason Freed, fw...@igalia.com
On Friday, July 8, 2022 at 9:25:25 AM UTC-7 Mason Freed wrote:
On Thursday, July 7, 2022 at 6:58:53 PM UTC-7 fw...@igalia.com wrote:
On 07/07/2022 22:17, Mason Freed wrote:

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

Yes

H Mason,

Do you have any patch pending to update wpt/interfaces/html.idl?

Thanks for the question. My understanding of html.idl (see the top of the file) is that it gets autogenerated based on landed specs. And I would have thought that since the spec now contains `beforeinput` in this section, that would be enough. However, since that landed about a month ago, seems like not. Let me know if you know the proper way to kick webref to do this, and I'm happy to do it.

Thanks to jarhar@ I found the answer to this question. Turns out there's something broken on that system, so no changes have landed for just over a month. Here's the latest PR which does include `beforeinput`. So seems like we just need a wait a bit for that to get resolved.

Mike West

unread,
Jul 11, 2022, 8:12:27 AM7/11/22
to Mason Freed, Daniel Vogelheim, blink-dev, fw...@igalia.com
LGTM3.

+Daniel Vogelheim to make sure any implications for Trusted Types and/or the Sanitizer API are taken care of.

-mike


--
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.

Mason Freed

unread,
Jul 11, 2022, 5:54:36 PM7/11/22
to blink-dev, mk...@chromium.org, blink-dev, fw...@igalia.com, mas...@chromium.org, voge...@chromium.org
Thank you all!

Frédéric Wang

unread,
Jul 12, 2022, 12:51:52 AM7/12/22
to blin...@chromium.org
On 08/07/2022 18:28, Mason Freed wrote:


On Friday, July 8, 2022 at 9:25:25 AM UTC-7 Mason Freed wrote:
On Thursday, July 7, 2022 at 6:58:53 PM UTC-7 fw...@igalia.com wrote:
On 07/07/2022 22:17, Mason Freed wrote:

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

Yes

H Mason,

Do you have any patch pending to update wpt/interfaces/html.idl?

Thanks for the question. My understanding of html.idl (see the top of the file) is that it gets autogenerated based on landed specs. And I would have thought that since the spec now contains `beforeinput` in this section, that would be enough. However, since that landed about a month ago, seems like not. Let me know if you know the proper way to kick webref to do this, and I'm happy to do it.

Thanks to jarhar@ I found the answer to this question. Turns out there's something broken on that system, so no changes have landed for just over a month. Here's the latest PR which does include `beforeinput`. So seems like we just need a wait a bit for that to get resolved.

Thank you for checking Mason. I indeed was vaguely remembering that update was more-or-less automatic, great that you detected the issue.

-- 
Frédéric Wang
Reply all
Reply to author
Forward
0 new messages