diff options
author | Pyfisch <pyfisch@gmail.com> | 2018-11-17 17:02:31 +0100 |
---|---|---|
committer | Pyfisch <pyfisch@gmail.com> | 2018-11-19 22:07:05 +0100 |
commit | b936fea79de985213c053e67f77458b37f4b2995 (patch) | |
tree | ce7ef296552b39c9a5d3c427f3d1d1a955cb9216 /components/script/script_thread.rs | |
parent | 1ac6f435c8637d01279b51fecb535a19b639aea5 (diff) | |
download | servo-b936fea79de985213c053e67f77458b37f4b2995.tar.gz servo-b936fea79de985213c053e67f77458b37f4b2995.zip |
Forward WebDriver CompositionEvent
Dispatch composition events in JS.
Insert characters from composition events to text input.
CompositionEvents currently can only be
created by WebDriver and not by embedders.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 4b866f6d996..166e98bac56 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -113,7 +113,7 @@ use profile_traits::time::{self as profile_time, profile, ProfilerCategory}; use script_layout_interface::message::{self, Msg, NewLayoutThreadInfo, ReflowGoal}; use script_traits::webdriver_msg::WebDriverScriptCommand; use script_traits::CompositorEvent::{ - KeyboardEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent, TouchEvent, + CompositionEvent, KeyboardEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent, TouchEvent, }; use script_traits::{CompositorEvent, ConstellationControlMsg}; use script_traits::{DiscardBrowsingContext, DocumentActivity, EventResult}; @@ -2881,6 +2881,14 @@ impl ScriptThread { }; document.dispatch_key_event(key_event); }, + + CompositionEvent(composition_event) => { + let document = match { self.documents.borrow().find_document(pipeline_id) } { + Some(document) => document, + None => return warn!("Message sent to closed pipeline {}.", pipeline_id), + }; + document.dispatch_composition_event(composition_event); + }, } } |