Auto merge of #8785 - mbrubeck:fixed-hit-test, r=pcwalton

Add slow path for hit testing of iframe behind positioned content layer

Fixes browser.html blocker #8759. r? @pcwalton

This adds a slow path for cases where the compositor's layer-based hit testing is incorrect.  If the script task discovers that a mouse event should have been dispatched to an iframe, it bounces the event back to the constellation to be forwarded to the correct pipeline.

This isn't terribly slow (on the slow path, it adds one extra round-trip message between script and constellation), but if we want to optimize this better we could instead replace the compositor's layer hit testing with display list hit testing in the paint task.  This would be a more complicated change that I think we should save for a follow-up.

This only fixes mouse input for now.  A basically-identical change will be needed for touch-screen input, whether we stick with this approach or switch to the paint task.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8785)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-04 02:54:22 +05:30
commit bc62b5aadb
15 changed files with 100 additions and 68 deletions

View file

@ -30,13 +30,13 @@ use msg::compositor_msg::{Epoch, EventResult, FrameTreeId, LayerId, LayerKind};
use msg::compositor_msg::{LayerProperties, ScrollPolicy}; use msg::compositor_msg::{LayerProperties, ScrollPolicy};
use msg::constellation_msg::CompositorMsg as ConstellationMsg; use msg::constellation_msg::CompositorMsg as ConstellationMsg;
use msg::constellation_msg::{AnimationState, Image, PixelFormat}; use msg::constellation_msg::{AnimationState, Image, PixelFormat};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, MouseButton};
use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData}; use msg::constellation_msg::{NavigationDirection, PipelineId, WindowSizeData};
use pipeline::CompositionPipeline; use pipeline::CompositionPipeline;
use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest}; use profile_traits::mem::{self, ReportKind, Reporter, ReporterRequest};
use profile_traits::time::{self, ProfilerCategory, profile}; use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent}; use script_traits::CompositorEvent::{MouseMoveEvent, TouchEvent};
use script_traits::{ConstellationControlMsg, LayoutControlMsg, MouseButton}; use script_traits::{ConstellationControlMsg, LayoutControlMsg};
use script_traits::{TouchEventType, TouchId}; use script_traits::{TouchEventType, TouchId};
use scrolling::ScrollingTimerProxy; use scrolling::ScrollingTimerProxy;
use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::Entry::{Occupied, Vacant};

View file

@ -12,9 +12,9 @@ use layers::color::Color;
use layers::geometry::LayerPixel; use layers::geometry::LayerPixel;
use layers::layers::{Layer, LayerBufferSet}; use layers::layers::{Layer, LayerBufferSet};
use msg::compositor_msg::{Epoch, LayerId, LayerProperties, ScrollPolicy}; use msg::compositor_msg::{Epoch, LayerId, LayerProperties, ScrollPolicy};
use msg::constellation_msg::PipelineId; use msg::constellation_msg::{MouseEventType, PipelineId};
use script_traits::CompositorEvent; use script_traits::CompositorEvent;
use script_traits::CompositorEvent::{ClickEvent, MouseDownEvent, MouseMoveEvent, MouseUpEvent}; use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent};
use script_traits::ConstellationControlMsg; use script_traits::ConstellationControlMsg;
use std::rc::Rc; use std::rc::Rc;
use windowing::{MouseWindowEvent, WindowMethods}; use windowing::{MouseWindowEvent, WindowMethods};
@ -372,11 +372,11 @@ impl CompositorLayer for Layer<CompositorData> {
let event_point = cursor.to_untyped(); let event_point = cursor.to_untyped();
let message = match event { let message = match event {
MouseWindowEvent::Click(button, _) => MouseWindowEvent::Click(button, _) =>
ClickEvent(button, event_point), MouseButtonEvent(MouseEventType::Click, button, event_point),
MouseWindowEvent::MouseDown(button, _) => MouseWindowEvent::MouseDown(button, _) =>
MouseDownEvent(button, event_point), MouseButtonEvent(MouseEventType::MouseDown, button, event_point),
MouseWindowEvent::MouseUp(button, _) => MouseWindowEvent::MouseUp(button, _) =>
MouseUpEvent(button, event_point), MouseButtonEvent(MouseEventType::MouseUp, button, event_point),
}; };
self.send_event(compositor, message); self.send_event(compositor, message);
} }

View file

@ -613,6 +613,19 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
debug!("constellation got focus message"); debug!("constellation got focus message");
self.handle_focus_msg(pipeline_id); self.handle_focus_msg(pipeline_id);
} }
Request::Script(FromScriptMsg::ForwardMouseButtonEvent(
pipeline_id, event_type, button, point)) => {
if let Some(pipeline) = self.pipelines.get(&pipeline_id) {
pipeline.script_chan.send(ConstellationControlMsg::SendEvent(pipeline_id,
CompositorEvent::MouseButtonEvent(event_type, button, point)));
}
}
Request::Script(FromScriptMsg::ForwardMouseMoveEvent(pipeline_id, point)) => {
if let Some(pipeline) = self.pipelines.get(&pipeline_id) {
pipeline.script_chan.send(ConstellationControlMsg::SendEvent(pipeline_id,
CompositorEvent::MouseMoveEvent(Some(point))));
}
}
Request::Script(FromScriptMsg::GetClipboardContents(sender)) => { Request::Script(FromScriptMsg::GetClipboardContents(sender)) => {
let result = self.clipboard_ctx.as_ref().map_or( let result = self.clipboard_ctx.as_ref().map_or(
"".to_owned(), "".to_owned(),

View file

@ -11,9 +11,9 @@ use euclid::size::TypedSize2D;
use euclid::{Point2D, Size2D}; use euclid::{Point2D, Size2D};
use layers::geometry::DevicePixel; use layers::geometry::DevicePixel;
use layers::platform::surface::NativeDisplay; use layers::platform::surface::NativeDisplay;
use msg::constellation_msg::{Key, KeyModifiers, KeyState}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, MouseButton};
use net_traits::net_error_list::NetError; use net_traits::net_error_list::NetError;
use script_traits::{MouseButton, TouchEventType, TouchId}; use script_traits::{TouchEventType, TouchId};
use std::fmt::{Debug, Error, Formatter}; use std::fmt::{Debug, Error, Formatter};
use std::rc::Rc; use std::rc::Rc;
use url::Url; use url::Url;
@ -27,7 +27,6 @@ pub enum MouseWindowEvent {
MouseUp(MouseButton, TypedPoint2D<DevicePixel, f32>), MouseUp(MouseButton, TypedPoint2D<DevicePixel, f32>),
} }
#[derive(Clone)] #[derive(Clone)]
pub enum WindowNavigateMsg { pub enum WindowNavigateMsg {
Forward, Forward,

View file

@ -7,6 +7,7 @@
use canvas_traits::CanvasMsg; use canvas_traits::CanvasMsg;
use compositor_msg::Epoch; use compositor_msg::Epoch;
use euclid::point::Point2D;
use euclid::scale_factor::ScaleFactor; use euclid::scale_factor::ScaleFactor;
use euclid::size::{Size2D, TypedSize2D}; use euclid::size::{Size2D, TypedSize2D};
use hyper::header::Headers; use hyper::header::Headers;
@ -283,6 +284,10 @@ pub enum ScriptMsg {
Failure(Failure), Failure(Failure),
/// Notifies the constellation that this frame has received focus. /// Notifies the constellation that this frame has received focus.
Focus(PipelineId), Focus(PipelineId),
/// Re-send a mouse button event that was sent to the parent window.
ForwardMouseButtonEvent(PipelineId, MouseEventType, MouseButton, Point2D<f32>),
/// Re-send a mouse move event that was sent to the parent window.
ForwardMouseMoveEvent(PipelineId, Point2D<f32>),
/// Requests that the constellation retrieve the current contents of the clipboard /// Requests that the constellation retrieve the current contents of the clipboard
GetClipboardContents(IpcSender<String>), GetClipboardContents(IpcSender<String>),
/// <head> tag finished parsing /// <head> tag finished parsing
@ -307,6 +312,24 @@ pub enum ScriptMsg {
ViewportConstrained(PipelineId, ViewportConstraints), ViewportConstrained(PipelineId, ViewportConstraints),
} }
#[derive(Deserialize, HeapSizeOf, Serialize)]
pub enum MouseEventType {
Click,
MouseDown,
MouseUp,
}
/// The mouse button involved in the event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum MouseButton {
/// The left mouse button.
Left,
/// The middle mouse button.
Middle,
/// The right mouse button.
Right,
}
/// Messages from the paint task to the constellation. /// Messages from the paint task to the constellation.
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub enum PaintMsg { pub enum PaintMsg {

View file

@ -5,12 +5,15 @@
use document_loader::{DocumentLoader, LoadType}; use document_loader::{DocumentLoader, LoadType};
use dom::attr::{Attr, AttrValue}; use dom::attr::{Attr, AttrValue};
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods;
use dom::bindings::codegen::Bindings::DocumentBinding; use dom::bindings::codegen::Bindings::DocumentBinding;
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull; use dom::bindings::codegen::Bindings::EventHandlerBinding::EventHandlerNonNull;
use dom::bindings::codegen::Bindings::EventHandlerBinding::OnErrorEventHandlerNonNull; use dom::bindings::codegen::Bindings::EventHandlerBinding::OnErrorEventHandlerNonNull;
use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods; use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
use dom::bindings::codegen::Bindings::HTMLIFrameElementBinding::HTMLIFrameElementMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter; use dom::bindings::codegen::Bindings::NodeFilterBinding::NodeFilter;
use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceMethods;
@ -82,13 +85,14 @@ use msg::compositor_msg::ScriptToCompositorMsg;
use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER};
use msg::constellation_msg::{AnimationState, PipelineId}; use msg::constellation_msg::{AnimationState, PipelineId};
use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyModifiers, KeyState, MozBrowserEvent, SubpageId}; use msg::constellation_msg::{ConstellationChan, FocusType, Key, KeyModifiers, KeyState};
use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, SubpageId};
use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl}; use net_traits::ControlMsg::{GetCookiesForUrl, SetCookiesForUrl};
use net_traits::CookieSource::NonHTTP; use net_traits::CookieSource::NonHTTP;
use net_traits::{AsyncResponseTarget, PendingAsyncLoad}; use net_traits::{AsyncResponseTarget, PendingAsyncLoad};
use num::ToPrimitive; use num::ToPrimitive;
use script_task::{MainThreadScriptMsg, Runnable}; use script_task::{MainThreadScriptMsg, Runnable};
use script_traits::{MouseButton, TouchEventType, TouchId, UntrustedNodeAddress}; use script_traits::{TouchEventType, TouchId, UntrustedNodeAddress};
use std::ascii::AsciiExt; use std::ascii::AsciiExt;
use std::borrow::ToOwned; use std::borrow::ToOwned;
use std::boxed::FnBox; use std::boxed::FnBox;
@ -603,7 +607,7 @@ impl Document {
pub fn handle_mouse_event(&self, pub fn handle_mouse_event(&self,
js_runtime: *mut JSRuntime, js_runtime: *mut JSRuntime,
_button: MouseButton, button: MouseButton,
client_point: Point2D<f32>, client_point: Point2D<f32>,
mouse_event_type: MouseEventType) { mouse_event_type: MouseEventType) {
let mouse_event_type_string = match mouse_event_type { let mouse_event_type_string = match mouse_event_type {
@ -634,6 +638,21 @@ impl Document {
}, },
}; };
// If the target is an iframe, forward the event to the child document.
if let Some(iframe) = el.downcast::<HTMLIFrameElement>() {
if let Some(pipeline_id) = iframe.pipeline_id() {
let rect = iframe.upcast::<Element>().GetBoundingClientRect();
let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32);
let child_point = client_point - child_origin;
let event = ConstellationMsg::ForwardMouseButtonEvent(pipeline_id,
mouse_event_type,
button, child_point);
self.window.constellation_chan().0.send(event).unwrap();
}
return;
}
let node = el.upcast::<Node>(); let node = el.upcast::<Node>();
debug!("{} on {:?}", mouse_event_type_string, node.debug_str()); debug!("{} on {:?}", mouse_event_type_string, node.debug_str());
// Prevent click event if form control element is disabled. // Prevent click event if form control element is disabled.
@ -766,12 +785,24 @@ impl Document {
if mouse_over_addresses.len() > 0 { if mouse_over_addresses.len() > 0 {
let top_most_node = node::from_untrusted_node_address(js_runtime, let top_most_node = node::from_untrusted_node_address(js_runtime,
mouse_over_addresses[0]); mouse_over_addresses[0]);
let client_point = client_point.unwrap(); // Must succeed because hit test succeeded.
// If the target is an iframe, forward the event to the child document.
if let Some(iframe) = top_most_node.downcast::<HTMLIFrameElement>() {
if let Some(pipeline_id) = iframe.pipeline_id() {
let rect = iframe.upcast::<Element>().GetBoundingClientRect();
let child_origin = Point2D::new(rect.X() as f32, rect.Y() as f32);
let child_point = client_point - child_origin;
let event = ConstellationMsg::ForwardMouseMoveEvent(pipeline_id, child_point);
self.window.constellation_chan().0.send(event).unwrap();
}
return;
}
let target = top_most_node.upcast(); let target = top_most_node.upcast();
if let Some(client_point) = client_point {
self.fire_mouse_event(client_point, target, "mousemove".to_owned()); self.fire_mouse_event(client_point, target, "mousemove".to_owned());
} }
}
// Store the current mouse over targets for next frame // Store the current mouse over targets for next frame
prev_mouse_over_targets.clear(); prev_mouse_over_targets.clear();
@ -1362,14 +1393,6 @@ impl Document {
} }
} }
#[derive(HeapSizeOf)]
pub enum MouseEventType {
Click,
MouseDown,
MouseUp,
}
#[derive(PartialEq, HeapSizeOf)] #[derive(PartialEq, HeapSizeOf)]
pub enum DocumentSource { pub enum DocumentSource {
FromParser, FromParser,

View file

@ -185,6 +185,11 @@ impl HTMLIFrameElement {
self.containing_page_pipeline_id.get() self.containing_page_pipeline_id.get()
} }
#[inline]
pub fn pipeline_id(&self) -> Option<PipelineId> {
self.pipeline_id.get()
}
#[inline] #[inline]
pub fn subpage_id(&self) -> Option<SubpageId> { pub fn subpage_id(&self) -> Option<SubpageId> {
self.subpage_id.get() self.subpage_id.get()

View file

@ -31,8 +31,7 @@ use dom::bindings::js::{Root, RootCollectionPtr, RootedReference};
use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference, trace_refcounted_objects}; use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference, trace_refcounted_objects};
use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables}; use dom::bindings::trace::{JSTraceable, RootedVec, trace_traceables};
use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS}; use dom::bindings::utils::{DOM_CALLBACKS, WRAP_CALLBACKS};
use dom::document::{Document, DocumentProgressHandler, IsHTMLDocument}; use dom::document::{Document, DocumentProgressHandler, DocumentSource, IsHTMLDocument};
use dom::document::{DocumentSource, MouseEventType};
use dom::element::Element; use dom::element::Element;
use dom::event::{Event, EventBubbles, EventCancelable}; use dom::event::{Event, EventBubbles, EventCancelable};
use dom::htmlanchorelement::HTMLAnchorElement; use dom::htmlanchorelement::HTMLAnchorElement;
@ -65,7 +64,7 @@ use mem::heap_size_of_self_and_children;
use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg}; use msg::compositor_msg::{EventResult, LayerId, ScriptToCompositorMsg};
use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, FocusType, LoadData}; use msg::constellation_msg::{ConstellationChan, FocusType, LoadData};
use msg::constellation_msg::{MozBrowserEvent, PipelineId}; use msg::constellation_msg::{MouseButton, MouseEventType, MozBrowserEvent, PipelineId};
use msg::constellation_msg::{PipelineNamespace}; use msg::constellation_msg::{PipelineNamespace};
use msg::constellation_msg::{SubpageId, WindowSizeData, WorkerId}; use msg::constellation_msg::{SubpageId, WindowSizeData, WorkerId};
use msg::webdriver_msg::WebDriverScriptCommand; use msg::webdriver_msg::WebDriverScriptCommand;
@ -78,11 +77,9 @@ use page::{Frame, IterablePage, Page};
use parse::html::{ParseContext, parse_html}; use parse::html::{ParseContext, parse_html};
use profile_traits::mem::{self, OpaqueSender, Report, ReportKind, ReportsChan}; use profile_traits::mem::{self, OpaqueSender, Report, ReportKind, ReportsChan};
use profile_traits::time::{self, ProfilerCategory, profile}; use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::CompositorEvent::{ClickEvent, ResizeEvent}; use script_traits::CompositorEvent::{KeyEvent, MouseButtonEvent, MouseMoveEvent, ResizeEvent};
use script_traits::CompositorEvent::{KeyEvent, MouseMoveEvent}; use script_traits::CompositorEvent::{TouchEvent};
use script_traits::CompositorEvent::{MouseDownEvent, MouseUpEvent, TouchEvent}; use script_traits::{CompositorEvent, ConstellationControlMsg, InitialScriptState, NewLayoutInfo};
use script_traits::{CompositorEvent, ConstellationControlMsg};
use script_traits::{InitialScriptState, MouseButton, NewLayoutInfo};
use script_traits::{OpaqueScriptLayoutChannel, ScriptState, ScriptTaskFactory}; use script_traits::{OpaqueScriptLayoutChannel, ScriptState, ScriptTaskFactory};
use script_traits::{TimerEvent, TimerEventRequest, TimerSource}; use script_traits::{TimerEvent, TimerEventRequest, TimerSource};
use script_traits::{TouchEventType, TouchId}; use script_traits::{TouchEventType, TouchId};
@ -1786,16 +1783,8 @@ impl ScriptTask {
self.handle_resize_event(pipeline_id, new_size); self.handle_resize_event(pipeline_id, new_size);
} }
ClickEvent(button, point) => { MouseButtonEvent(event_type, button, point) => {
self.handle_mouse_event(pipeline_id, MouseEventType::Click, button, point); self.handle_mouse_event(pipeline_id, event_type, button, point);
}
MouseDownEvent(button, point) => {
self.handle_mouse_event(pipeline_id, MouseEventType::MouseDown, button, point);
}
MouseUpEvent(button, point) => {
self.handle_mouse_event(pipeline_id, MouseEventType::MouseUp, button, point);
} }
MouseMoveEvent(point) => { MouseMoveEvent(point) => {

View file

@ -34,6 +34,7 @@ use msg::compositor_msg::{Epoch, LayerId, ScriptToCompositorMsg};
use msg::constellation_msg::ScriptMsg as ConstellationMsg; use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData}; use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId}; use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId};
use msg::constellation_msg::{MouseButton, MouseEventType};
use msg::constellation_msg::{MozBrowserEvent, PipelineNamespaceId}; use msg::constellation_msg::{MozBrowserEvent, PipelineNamespaceId};
use msg::webdriver_msg::WebDriverScriptCommand; use msg::webdriver_msg::WebDriverScriptCommand;
use net_traits::ResourceTask; use net_traits::ResourceTask;
@ -146,17 +147,6 @@ pub enum ConstellationControlMsg {
}, },
} }
/// The mouse button involved in the event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum MouseButton {
/// The left mouse button.
Left,
/// The middle mouse button.
Middle,
/// The right mouse button.
Right,
}
/// The type of input represented by a multi-touch event. /// The type of input represented by a multi-touch event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)] #[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum TouchEventType { pub enum TouchEventType {
@ -181,12 +171,8 @@ pub struct TouchId(pub i32);
pub enum CompositorEvent { pub enum CompositorEvent {
/// The window was resized. /// The window was resized.
ResizeEvent(WindowSizeData), ResizeEvent(WindowSizeData),
/// A point was clicked. /// A mouse button state changed.
ClickEvent(MouseButton, Point2D<f32>), MouseButtonEvent(MouseEventType, MouseButton, Point2D<f32>),
/// A mouse button was pressed on a point.
MouseDownEvent(MouseButton, Point2D<f32>),
/// A mouse button was released on a point.
MouseUpEvent(MouseButton, Point2D<f32>),
/// The mouse was moved over a point (or was moved out of the recognizable region). /// The mouse was moved over a point (or was moved out of the recognizable region).
MouseMoveEvent(Option<Point2D<f32>>), MouseMoveEvent(Option<Point2D<f32>>),
/// A touch event was generated with a touch ID and location. /// A touch event was generated with a touch ID and location.

View file

@ -14,8 +14,7 @@ use compositing::windowing::{WindowEvent, MouseWindowEvent};
use euclid::point::Point2D; use euclid::point::Point2D;
use euclid::size::Size2D; use euclid::size::Size2D;
use libc::{c_double, c_int}; use libc::{c_double, c_int};
use msg::constellation_msg::{self, KeyModifiers, KeyState}; use msg::constellation_msg::{self, KeyModifiers, KeyState, MouseButton};
use script_traits::MouseButton;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
pub struct ServoCefBrowserHost { pub struct ServoCefBrowserHost {

View file

@ -253,7 +253,7 @@ impl Window {
/// Helper function to handle a click /// Helper function to handle a click
fn handle_mouse(&self, button: glutin::MouseButton, action: glutin::ElementState, x: i32, y: i32) { fn handle_mouse(&self, button: glutin::MouseButton, action: glutin::ElementState, x: i32, y: i32) {
use script_traits::MouseButton; use msg::constellation_msg::MouseButton;
// FIXME(tkuehn): max pixel dist should be based on pixel density // FIXME(tkuehn): max pixel dist should be based on pixel density
let max_pixel_dist = 10f64; let max_pixel_dist = 10f64;

1
ports/gonk/Cargo.lock generated
View file

@ -17,7 +17,6 @@ dependencies = [
"net_traits 0.0.1", "net_traits 0.0.1",
"profile 0.0.1", "profile 0.0.1",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1",
"servo 0.0.1", "servo 0.0.1",
"time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -18,9 +18,6 @@ path = "../../components/msg"
[dependencies.script] [dependencies.script]
path = "../../components/script" path = "../../components/script"
[dependencies.script_traits]
path = "../../components/script_traits"
[dependencies.net_traits] [dependencies.net_traits]
path = "../../components/net_traits" path = "../../components/net_traits"

View file

@ -6,7 +6,7 @@ use compositing::windowing::{WindowEvent, MouseWindowEvent};
use errno::errno; use errno::errno;
use euclid::point::Point2D; use euclid::point::Point2D;
use libc::{c_int, c_long, time_t}; use libc::{c_int, c_long, time_t};
use script_traits::MouseButton; use msg::constellation_msg::MouseButton;
use std::fs::File; use std::fs::File;
use std::io::Read; use std::io::Read;
use std::mem::{size_of, transmute, zeroed}; use std::mem::{size_of, transmute, zeroed};

View file

@ -33,7 +33,6 @@ extern crate layers;
extern crate libc; extern crate libc;
extern crate msg; extern crate msg;
extern crate net_traits; extern crate net_traits;
extern crate script_traits;
extern crate servo; extern crate servo;
extern crate time; extern crate time;
extern crate url; extern crate url;