1. Assume the keyboard is SHOWN.
2. KeyboardController::SetContainerType will queue a container type change, start the hide animation and change state to HIDDEN. Normally, the hide animation will complete, triggering the container type change.
3. But suppose ShowKeyboard gets called immediately after SetContainerType. ShowKeyboard thinks the keyboard is HIDDEN, so it just shows the keyboard. This prevents the hide animation from completing and we never change our container type.
This sequence of events actually happens in the stylus handwriting feature due to a recent change [1]. When the user taps with stylus, IME will trigger a container type change (to floating mode). However, we immediately invoke ShowKeyboard through DisplayVirtualKeyboard, which prevents our container change from going through.
[1] https://chromium-review.googlesource.com/c/chromium/src/+/978841
Comment 1 by shend@chromium.org
, Jun 6 2018