On 2020/01/09 3:35, James Graham wrote:

On 08/01/2020 09:54, Masayuki Nakano wrote:
Summary: "beforeinput" event is useful for web apps which manage input data into `<input>`, `<textarea>` and/or `contenteditable`. This event is fired before our editor modifies value or DOM tree and some types are cancelable. Therefore, if some user inputs are not acceptable for the web app, they can cancel it, and/or modifies the value or the DOM tree as they want.

Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=970802
Standard: https://w3c.github.io/uievents/#event-type-beforeinput
Platform coverage: all
Preference: dom.input_events.beforeinput.enabled (false by default for now)
DevTools bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1607686

Are there wpt tests for this feature?

Unfortunately, it's tested only in simple cases:
https://searchfox.org/mozilla-central/search?q=beforeinput&case=false&regexp=false&path=web-platform
The reason is, "beforeinput" event is fired when browser's built-in editor modifies the DOM, however, most of them the cases are caused by browser specific shortcut keys, DnD, autocomplete, spellchecker, etc. Therefore, most of them are tested by mochitest.

What's the implementation status in other browsers?

Blink and WebKit implemented it:
Blink: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/W-Q1yWW-zas
WebKit: https://bugs.webkit.org/show_bug.cgi?id=163021

Except EdgeHTML, Gecko is the last one which does not support "beforeinput" event.

And also I forgot to write links to Input Events:
Level 1: https://rawgit.com/w3c/input-events/v1/index.html
Level 2: https://w3c.github.io/input-events/

We keep supporting Level 1 for now since Level 2 has some backward compatibility concerns:
https://github.com/w3c/input-events/issues/87
https://github.com/w3c/input-events/issues/86

(Chrome supports Level 1, Safari supports Level 2 partially.)


_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to