aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2015-12-04 02:54:22 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2015-12-04 02:54:22 +0530
commitbc62b5aadb62267582fbd65daa28438ce6c6ac9c (patch)
tree535a0f8a529fe0f76ee5b6e852a317b0f0d36203 /components/script_traits
parent5ee6fe120d43506e263cb4482b3a468d967a8386 (diff)
parent9551363bfba695b17c55cc551b87a6c0d16eb6a0 (diff)
downloadservo-bc62b5aadb62267582fbd65daa28438ce6c6ac9c.tar.gz
servo-bc62b5aadb62267582fbd65daa28438ce6c6ac9c.zip
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 -->
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/lib.rs20
1 files changed, 3 insertions, 17 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 8a5ffcb459f..ef86ee26085 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -34,6 +34,7 @@ use msg::compositor_msg::{Epoch, LayerId, ScriptToCompositorMsg};
use msg::constellation_msg::ScriptMsg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId, WindowSizeData};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData, SubpageId};
+use msg::constellation_msg::{MouseButton, MouseEventType};
use msg::constellation_msg::{MozBrowserEvent, PipelineNamespaceId};
use msg::webdriver_msg::WebDriverScriptCommand;
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.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum TouchEventType {
@@ -181,12 +171,8 @@ pub struct TouchId(pub i32);
pub enum CompositorEvent {
/// The window was resized.
ResizeEvent(WindowSizeData),
- /// A point was clicked.
- ClickEvent(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>),
+ /// A mouse button state changed.
+ MouseButtonEvent(MouseEventType, MouseButton, Point2D<f32>),
/// The mouse was moved over a point (or was moved out of the recognizable region).
MouseMoveEvent(Option<Point2D<f32>>),
/// A touch event was generated with a touch ID and location.