aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorImanol Fernandez <mortimergoro@gmail.com>2017-03-29 15:41:40 +0200
committerImanol Fernandez <mortimergoro@gmail.com>2017-04-12 15:43:14 +0200
commit0158b5b2af28a32eccdd36060c533bc33e862776 (patch)
treef006ef7d984e2c07458e72ac96fd62a4366f3f7c /components/script/script_thread.rs
parent69eda6a60cece433e91d4bc578e94d8d5dfc9544 (diff)
downloadservo-0158b5b2af28a32eccdd36060c533bc33e862776.tar.gz
servo-0158b5b2af28a32eccdd36060c533bc33e862776.zip
Implement Gamepad API
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 955887addf4..92537fa7abe 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -27,6 +27,7 @@ use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::Bindings::EventBinding::EventInit;
+use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods;
use dom::bindings::codegen::Bindings::TransitionEventBinding::TransitionEventInit;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, StringificationBehavior};
@@ -91,7 +92,6 @@ use script_traits::{ScriptThreadFactory, TimerEvent, TimerSchedulerMsg, TimerSou
use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress, WindowSizeData, WindowSizeType};
use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
use script_traits::CompositorEvent::{TouchEvent, TouchpadPressureEvent};
-use script_traits::WebVREventMsg;
use script_traits::webdriver_msg::WebDriverScriptCommand;
use serviceworkerjob::{Job, JobQueue, AsyncJobHandler};
use servo_config::opts;
@@ -119,7 +119,7 @@ use task_source::user_interaction::{UserInteractionTask, UserInteractionTaskSour
use time::Tm;
use url::Position;
use webdriver_handlers;
-use webvr_traits::WebVRMsg;
+use webvr_traits::{WebVREvent, WebVRMsg};
pub type ImageCacheMsg = (PipelineId, PendingImageResponse);
@@ -1070,8 +1070,8 @@ impl ScriptThread {
self.handle_reload(pipeline_id),
ConstellationControlMsg::ExitPipeline(pipeline_id, discard_browsing_context) =>
self.handle_exit_pipeline_msg(pipeline_id, discard_browsing_context),
- ConstellationControlMsg::WebVREvent(pipeline_id, event) =>
- self.handle_webvr_event(pipeline_id, event),
+ ConstellationControlMsg::WebVREvents(pipeline_id, events) =>
+ self.handle_webvr_events(pipeline_id, events),
msg @ ConstellationControlMsg::AttachLayout(..) |
msg @ ConstellationControlMsg::Viewport(..) |
msg @ ConstellationControlMsg::SetScrollState(..) |
@@ -2186,11 +2186,11 @@ impl ScriptThread {
}
}
- fn handle_webvr_event(&self, pipeline_id: PipelineId, event: WebVREventMsg) {
+ fn handle_webvr_events(&self, pipeline_id: PipelineId, events: Vec<WebVREvent>) {
let window = self.documents.borrow().find_window(pipeline_id);
if let Some(window) = window {
- let navigator = window.Navigator();
- navigator.handle_webvr_event(event);
+ let vr = window.Navigator().Vr();
+ vr.handle_webvr_events(events);
}
}