Missing textinput event
Categories
(Core :: DOM: Events, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: joeedh, Assigned: masayuki)
References
(Blocks 3 open bugs)
Details
(Keywords: dev-doc-needed, webcompat:platform-bug)
Attachments
(2 files)
Comment 1•11 years ago
|
||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
This is causing issues for WhatsApp Web, for their chat input when used with the MacOS Emoji picker, as per https://webcompat.com/issues/13503
Basically, they are listening for textInput
events (Chrome/WebKit) or compositionend
events (Firefox). When they see one they try to call preventDefault
on the event to stop the emoji from appearing, and then add their own annotated version of the emoji with document.execCommand("insertHTML")
instead.
But of course compositionend
events cannot be preventDefault
ed, so they end up getting two emoji in their chat input instead (and then a third, because the insertHTML
will cause another compositionend
to fire, since the first was not preventDefault
ed).
It's unclear to me how widespread this sort of code would be, but it's worth investigating to see whether textInput
needs to be supported by Firefox.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 5•6 years ago
|
||
See bug 1547409. Moving webcompat whiteboard tags to project flags.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 6•4 years ago
|
||
The original issue with WhatsApp https://webcompat.com/issues/13503 is now fixed by the website so I'm removing the from see also.
We haven't seen new issues in the wild related to this bug for some time now.
Assignee | ||
Comment 7•3 years ago
|
||
Blink's TextEvent
interface is here:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/events/text_event.idl
Definition and declaration are:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/events/text_event.h
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/events/text_event.cc
Looks like that it just exposes data
attribute, and sets string value except when pasting rich format.
Just random thoughts. If we exposes TextEvent
interface and ontextinput
attribute to the web, web apps may start to use different path from currently running on Firefox. And it seems that we don't need to support untrusted event for it. If so, just dispatching textInput
event might solve the compatibility issue of DraftJS with minimum change.
Ideally, if we can now whether running DraftJS or not in JSActor, dispatching synthesized event from beforeinput
event listener might be the safest and smallest fix.
Comment 8•3 years ago
|
||
I don't quite understand why supporting untrusted event affects anything here. In Chrome one can create the event using document.createEvent("textevent").
It feels rather risky to expose just textInput, but not the rest of the setup Chrome has.
Assignee | ||
Comment 9•3 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #8)
I don't quite understand why supporting untrusted event affects anything here. In Chrome one can create the event using document.createEvent("textevent").
In my idea, if and only if DraftJS wants textInput
event and it does not require untrusted one, dispatching fake textInput
events on it from chrome script is enough (comparing with implementing it for all web apps).
It feels rather risky to expose just textInput, but not the rest of the setup Chrome has.
If other web apps which do not have any problems with Firefox might be broken if we fully support textInput
event because I experienced a lot that web apps use feature detection for not corresponding feature... Therefore, I don't want to implement new but non-standard features only for a few web apps...
Assignee | ||
Comment 10•3 years ago
|
||
Of course, excepting the case that implementing such feature is the only way to make our users happy.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 11•2 years ago
•
|
||
Setting this to be re-triaged for webcompat priority, since we're shipping a draft.js intervention that maps textinput onto beforeinput.
Comment 12•2 years ago
|
||
https://bugs.chromium.org/p/chromium/issues/detail?id=382814 from 2014 is about removing textinput, and I can't see evidence that's ever going to be fixed. It's hard to tell how many sites actually depend on the event; the Chromium use counter suggests 1.2% of page loads fire this event. Based on the other entries I think that's only if there's actually a listener for the event, but I'm not totally sure.
Updated•2 years ago
|
Comment 13•2 years ago
|
||
Since we're shipping interventions for this breakage to alleviate the impact, let's add a webcompat priority P2.
Assignee | ||
Comment 14•2 years ago
|
||
(In reply to James Graham [:jgraham] from comment #12)
It's hard to tell how many sites actually depend on the event; the Chromium use counter suggests 1.2% of page loads fire this event. Based on the other entries I think that's only if there's actually a listener for the event, but I'm not totally sure.
Currently, only the major breakage reports come with Draft.js which should be replaced with Lexical in the future.
Therefore, I'm still thinking that using intervention addon is more reasonable for now than implementing this since dispatching additional events makes the web a little bit slower.
Updated•2 years ago
|
Comment 15•2 years ago
|
||
There has been another case found at SantanderBank, which should be fixable with the same draftJS intervention (using beforeinput as a drop-in replacement for textInput).
Updated•2 years ago
|
Updated•2 years ago
|
Updated•1 year ago
|
Assignee | ||
Comment 16•8 months ago
|
||
Unfortunately, we returned a CompositionEvent
for
Document.createEvent("textevent")
because we had a text event which we stopped
exposing to the web and was replaced with eCompositionChange
event.
Therefore, this change could potentially have a compatibility risk.
Assignee | ||
Comment 17•8 months ago
|
||
Depends on D200120
Assignee | ||
Comment 18•8 months ago
|
||
TODO:
- Add WPT for the basic behavior tests
- Add mochitests for DnD and IME composition
- (Although I'm not sure whether we can fix it,) fix
todo_isnot
inwindow_composition_text_querycontent.xhtml
Assignee | ||
Comment 19•8 months ago
|
||
Comment 20•7 months ago
|
||
Spec changes for UIEvents and DOM and corresponding tests have landed:
- https://github.com/w3c/uievents/pull/362
- https://github.com/web-platform-tests/wpt/pull/44472
- https://github.com/whatwg/dom/pull/1254
- https://github.com/web-platform-tests/wpt/pull/44467
Drag and drop is not yet specified, issue:
Updated•7 months ago
|
Assignee | ||
Updated•7 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Comment 21•6 months ago
|
||
Comment 22•6 months ago
|
||
Backed out for causing non-unified build bustages on nsIPrincipal.h
Failure log: https://treeherder.mozilla.org/logviewer?job_id=453857477&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/0df64aacdb659dc872d85fe396508457cdff7be7
Comment 23•6 months ago
|
||
Comment 24•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8d59698478cb
https://hg.mozilla.org/mozilla-central/rev/99fd7832396d
Updated•6 months ago
|
Updated•23 days ago
|
Description
•