mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Notify the embedder when it should display or hide an IME
This commit is contained in:
parent
05fe8fa08d
commit
42886613d3
8 changed files with 93 additions and 2 deletions
|
@ -40,6 +40,7 @@ use dom::virtualmethods::VirtualMethods;
|
|||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use mime_guess;
|
||||
use msg::constellation_msg::InputMethodType;
|
||||
use net_traits::{CoreResourceMsg, IpcSend};
|
||||
use net_traits::blob_url_store::get_blob_origin;
|
||||
use net_traits::filemanager_thread::{FileManagerThreadMsg, FilterPattern};
|
||||
|
@ -137,6 +138,25 @@ impl InputType {
|
|||
InputType::Week => "week",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_ime_type(&self) -> Option<InputMethodType> {
|
||||
match *self {
|
||||
InputType::Color => Some(InputMethodType::Color),
|
||||
InputType::Date => Some(InputMethodType::Date),
|
||||
InputType::DatetimeLocal => Some(InputMethodType::DatetimeLocal),
|
||||
InputType::Email => Some(InputMethodType::Email),
|
||||
InputType::Month => Some(InputMethodType::Month),
|
||||
InputType::Number => Some(InputMethodType::Number),
|
||||
InputType::Password => Some(InputMethodType::Password),
|
||||
InputType::Search => Some(InputMethodType::Search),
|
||||
InputType::Tel => Some(InputMethodType::Tel),
|
||||
InputType::Text => Some(InputMethodType::Text),
|
||||
InputType::Time => Some(InputMethodType::Time),
|
||||
InputType::Url => Some(InputMethodType::Url),
|
||||
InputType::Week => Some(InputMethodType::Week),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Atom> for InputType {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue