diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-04-02 17:52:12 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-04-03 01:24:33 +0200 |
commit | 6b127a8df8c893f9a8175bd63a04bb0c068c24c3 (patch) | |
tree | 613c1e5aae28867b7c133cb69d47a838c5214565 /components/script | |
parent | 85808c1cdd39a3afdc9815247ceb6f0fb7e9a31b (diff) | |
download | servo-6b127a8df8c893f9a8175bd63a04bb0c068c24c3.tar.gz servo-6b127a8df8c893f9a8175bd63a04bb0c068c24c3.zip |
Introduce a MouseButton enum.
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/dom/document.rs | 8 | ||||
-rw-r--r-- | components/script/script_task.rs | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 6069fef7e06..13a7ce25d3f 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -66,7 +66,7 @@ use msg::constellation_msg::{SUPER, ALT, SHIFT, CONTROL}; use net::resource_task::ControlMsg::{SetCookiesForUrl, GetCookiesForUrl}; use net::cookie_storage::CookieSource::NonHTTP; use script_task::Runnable; -use script_traits::UntrustedNodeAddress; +use script_traits::{MouseButton, UntrustedNodeAddress}; use util::{opts, namespace}; use util::str::{DOMString, split_html_space_chars}; use layout_interface::{ReflowGoal, ReflowQueryType}; @@ -216,7 +216,8 @@ pub trait DocumentHelpers<'a> { fn title_changed(self); fn send_title_to_compositor(self); fn dirty_all_nodes(self); - fn handle_click_event(self, js_runtime: *mut JSRuntime, _button: uint, point: Point2D<f32>); + fn handle_click_event(self, js_runtime: *mut JSRuntime, + button: MouseButton, point: Point2D<f32>); fn dispatch_key_event(self, key: Key, state: KeyState, modifiers: KeyModifiers, compositor: &mut Box<ScriptListener+'static>); @@ -483,7 +484,8 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> { } } - fn handle_click_event(self, js_runtime: *mut JSRuntime, _button: uint, point: Point2D<f32>) { + fn handle_click_event(self, js_runtime: *mut JSRuntime, + _button: MouseButton, point: Point2D<f32>) { debug!("ClickEvent: clicked at {:?}", point); let node = match self.hit_test(&point) { Some(node_address) => { diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 593bd40bdf0..ff69fabe760 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -1205,10 +1205,10 @@ impl ScriptTask { self.handle_reflow_event(pipeline_id); } - ClickEvent(_button, point) => { + ClickEvent(button, point) => { let page = get_page(&self.root_page(), pipeline_id); let document = page.document().root(); - document.r().handle_click_event(self.js_runtime.ptr, _button, point); + document.r().handle_click_event(self.js_runtime.ptr, button, point); } MouseDownEvent(..) => {} |