PSA: Fire beforeinput event before compositionupdate event during IME composition.

58 views
Skip to first unread message

Siye Liu

unread,
Sep 25, 2023, 8:30:06 PM9/25/23
to blink-dev, Siye Liu, sa...@microsoft.com, chri...@chromium.org, wangx...@chromium.org, hide...@chromium.org, sh...@chromium.org
Hi blink-dev,

We've been landing a change to enable new event ordering for beforeinput and compositionupdate during IME composition.

The previous event ordering for IME composition was:

keydown -> compositionstart -> beforeinput -> compositionupdate -> input -> keyup -> keydown -> beforeinput -> compositionupdate -> textInput -> input -> compositionend -> keyup.

The new ordering is:

keydown -> compositionstart -> compositionupdate -> beforeinput -> input -> keyup -> keydown -> compositionupdate -> beforeinput -> textInput -> input -> compositionend -> keyup.

This change aligns our event ordering with the behavior of Firefox and Safari, which fire the beforeinput event after the compositionupdate event.

The new event ordering is controlled by a runtime enabled feature flag that is set to stable status (enabled by default).

Mike Taylor

unread,
Sep 26, 2023, 11:04:39 AM9/26/23
to Siye Liu, blink-dev, sa...@microsoft.com, chri...@chromium.org, wangx...@chromium.org, hide...@chromium.org, sh...@chromium.org

Hi there -

Given that this change is web observable, have you all done any compatibility testing or analysis to ensure sites aren't relying on the differences between engines here (hopefully not, but you know...)?

--
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/bc3e3ab9-0740-4a4a-83f9-f95694f0127cn%40chromium.org.

Gary Kačmarčík (Кошмарчик)

unread,
Sep 26, 2023, 12:13:14 PM9/26/23
to Mike Taylor, Siye Liu, blink-dev, sa...@microsoft.com, chri...@chromium.org, wangx...@chromium.org, hide...@chromium.org, sh...@chromium.org
FWIW, according to https://bugs.chromium.org/p/chromium/issues/detail?id=1484762 we previously had compositonupdate->beforeinput but inadvertently changed it to the current order around M52.

Siye Liu

unread,
Oct 6, 2023, 1:58:16 PM10/6/23
to blink-dev, Gary Kačmarčík (Кошмарчик), blink-dev, chri...@chromium.org, wangx...@chromium.org, hide...@chromium.org, sh...@chromium.org, Mike Taylor
Hi Mike,
I haven't done compatibility testing because Chromium's behavior was introduced in M53 by accident. We previously had the correct input event sequence. The commit 65dc0072cfd947170ef4dbee2dd1f4c7c399156f - chromium/src - Git at Google (googlesource.com) is to fix the bug.
Reply all
Reply to author
Forward
0 new messages