aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/lib.rs
diff options
context:
space:
mode:
authorPyfisch <pyfisch@gmail.com>2018-11-17 17:02:31 +0100
committerPyfisch <pyfisch@gmail.com>2018-11-19 22:07:05 +0100
commitb936fea79de985213c053e67f77458b37f4b2995 (patch)
treece7ef296552b39c9a5d3c427f3d1d1a955cb9216 /components/script_traits/lib.rs
parent1ac6f435c8637d01279b51fecb535a19b639aea5 (diff)
downloadservo-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_traits/lib.rs')
-rw-r--r--components/script_traits/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index eba51e6ae75..9f5cdc62632 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -30,7 +30,8 @@ use http::HeaderMap;
use hyper::Method;
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::Error as IpcError;
-use keyboard_types::KeyboardEvent;
+use keyboard_types::webdriver::Event as WebDriverInputEvent;
+use keyboard_types::{CompositionEvent, KeyboardEvent};
use libc::c_void;
use msg::constellation_msg::{BrowsingContextId, HistoryStateId, PipelineId};
use msg::constellation_msg::{PipelineNamespaceId, TopLevelBrowsingContextId, TraversalDirection};
@@ -461,6 +462,8 @@ pub enum CompositorEvent {
),
/// A key was pressed.
KeyboardEvent(KeyboardEvent),
+ /// An event from the IME is dispatched.
+ CompositionEvent(CompositionEvent),
}
/// Requests a TimerEvent-Message be sent after the given duration.
@@ -691,7 +694,7 @@ pub enum WebDriverCommandMsg {
/// of a browsing context.
ScriptCommand(BrowsingContextId, WebDriverScriptCommand),
/// Act as if keys were pressed in the browsing context with the given ID.
- SendKeys(BrowsingContextId, Vec<KeyboardEvent>),
+ SendKeys(BrowsingContextId, Vec<WebDriverInputEvent>),
/// Set the window size.
SetWindowSize(
TopLevelBrowsingContextId,