Notify the embedder when it should display or hide an IME

This commit is contained in:
Fabrice Desré 2018-04-21 14:17:02 -07:00
parent 05fe8fa08d
commit 42886613d3
8 changed files with 93 additions and 2 deletions

View file

@ -812,6 +812,11 @@ impl Document {
elem.set_focus_state(false);
// FIXME: pass appropriate relatedTarget
self.fire_focus_event(FocusEventType::Blur, node, None);
// Notify the embedder to hide the input method.
if elem.input_method_type().is_some() {
self.send_to_constellation(ScriptMsg::HideIME);
}
}
self.focused.set(self.possibly_focused.get().r());
@ -826,6 +831,11 @@ impl Document {
if focus_type == FocusType::Element {
self.send_to_constellation(ScriptMsg::Focus);
}
// Notify the embedder to display an input method.
if let Some(kind) = elem.input_method_type() {
self.send_to_constellation(ScriptMsg::ShowIME(kind));
}
}
}