New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 718103 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 714791
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

beforeinput is not cancelable for composition

Project Member Reported by changwan@chromium.org, May 3 2017

Issue description

Chrome Version: 60.0.3089.0 (Developer Build) (64-bit)
OS: Linux (and possibly all OSes)

What steps will reproduce the problem?
(1) https://jsfiddle.net/galmacky/8v9usxts/10/
(2) Use Japanese Anthy IME.
(3) Type '0' or other numbers using Anthy IME.
(4) Check the console for logs.

What is the expected result?
cancelable returns true,
and e.preventDefault() cancels composition event.

What happens instead?
cancelable returns false, and composition is not canceled

Beforeinput cancellation is important because this is the only practical way to cancel composition as keydown / compositionstart cannot take a look at the composition data, and compostionupdate is not cancelable.

chongz@, is this a known issue?

 
changwan@ Yes, all typing and IME related actions are intentionally made non-cancelable.

I understand this is undesirable, but please find more details in https://github.com/w3c/input-events/pull/50
Mergedinto: 714791
Status: Duplicate (was: Assigned)
This is intended, I meant to fill you in on this.  I actually insisted beforeinput for regular compositions not be cancelable until we fully understand the consequences and have a clear use case, and the lack of cancelability is in "Level 1" spec we follow.  Adding cancelability would correspond to meeting level 2 spec: http://crbug.com/714791

See https://docs.google.com/document/d/1yPZEkHl_WOPjVeilZjE1XmlyjLCe-uS7THI0SboyrMM/edit#heading=h.b8dg6x6azemh for more reasons.
Ok, thanks for the quick replies.

I'm working on a mechanism to enable the cancellation, wish I could prove the feasibility soon.

FYI, the related use cases include:
1) https://bugs.chromium.org/p/chromium/issues/detail?id=692387
2) b/37444073

For 1), I'm not sure I fully understand the problem, but in my view cancelling beforeinput is basically the same thing as editing the textbox with JS to remove the effect of the composition.  In fact the latter case I think is easier to detect that we should send restartInput() than the former (because many use cases of beforeinput cancellation are actually to reinsert the input with different styling).  So I don't think it's necessarily a reason to support cancellation.

For 2), I was thinking we should probably add some specific input event for Enter and Backspace which seem to need special treatment, which might be sent on yukawa@'s special IME event proposal on https://b.corp.google.com/issues/37444073#comment10 .  Cancelling beforeinput which contains a lot of extra text than the Enter is not that helpful, I don't think.

Sign in to add a comment