aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/message.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-10-17 17:09:25 -0500
committerGitHub <noreply@github.com>2017-10-17 17:09:25 -0500
commitca08271345f78fa881c174545f5b69a8ccb78143 (patch)
tree6e1244687e960df40313b3a24a167135654dae31 /components/script_layout_interface/message.rs
parent0e62a5829b7c29ae2667a21a439aff1e89201bf3 (diff)
parentb5d51dd2636935471447fc741ffbb95c62e37f94 (diff)
downloadservo-ca08271345f78fa881c174545f5b69a8ccb78143.tar.gz
servo-ca08271345f78fa881c174545f5b69a8ccb78143.zip
Auto merge of #18704 - mrobinson:wr-hit-testing, r=jdm,glennw,mbrubeck
Switch to using WebRender hit testing This trades quite a bit of complicated code in Servo for few more messages and a significant performance improvement. In particular, WebRender can search the entire display list at once instead of ping-ponging down the pipeline tree. This allows us to send mouse events to the correct pipeline immediately. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they should not change behavior. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18704) <!-- Reviewable:end -->
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r--components/script_layout_interface/message.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs
index a026b349ab8..6f8009ecdd8 100644
--- a/components/script_layout_interface/message.rs
+++ b/components/script_layout_interface/message.rs
@@ -100,6 +100,11 @@ pub enum Msg {
SetNavigationStart(f64),
}
+#[derive(Debug, PartialEq)]
+pub enum NodesFromPointQueryType {
+ All,
+ Topmost,
+}
/// Any query to perform with this reflow.
#[derive(Debug, PartialEq)]
@@ -109,7 +114,6 @@ pub enum ReflowGoal {
ContentBoxQuery(TrustedNodeAddress),
ContentBoxesQuery(TrustedNodeAddress),
NodeOverflowQuery(TrustedNodeAddress),
- HitTestQuery(Point2D<f32>, bool),
NodeScrollRootIdQuery(TrustedNodeAddress),
NodeGeometryQuery(TrustedNodeAddress),
NodeScrollGeometryQuery(TrustedNodeAddress),
@@ -117,7 +121,7 @@ pub enum ReflowGoal {
OffsetParentQuery(TrustedNodeAddress),
MarginStyleQuery(TrustedNodeAddress),
TextIndexQuery(TrustedNodeAddress, i32, i32),
- NodesFromPoint(Point2D<f32>),
+ NodesFromPointQuery(Point2D<f32>, NodesFromPointQueryType),
}
impl ReflowGoal {
@@ -125,9 +129,8 @@ impl ReflowGoal {
/// be present or false if it only needs stacking-relative positions.
pub fn needs_display_list(&self) -> bool {
match *self {
- ReflowGoal::NodesFromPoint(..) | ReflowGoal::HitTestQuery(..) |
- ReflowGoal::TextIndexQuery(..) | ReflowGoal::TickAnimations |
- ReflowGoal::Full => true,
+ ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::TextIndexQuery(..) |
+ ReflowGoal::TickAnimations | ReflowGoal::Full => true,
ReflowGoal::ContentBoxQuery(_) | ReflowGoal::ContentBoxesQuery(_) |
ReflowGoal::NodeGeometryQuery(_) | ReflowGoal::NodeScrollGeometryQuery(_) |
ReflowGoal::NodeOverflowQuery(_) | ReflowGoal::NodeScrollRootIdQuery(_) |
@@ -141,12 +144,13 @@ impl ReflowGoal {
pub fn needs_display(&self) -> bool {
match *self {
ReflowGoal::MarginStyleQuery(_) | ReflowGoal::TextIndexQuery(..) |
- ReflowGoal::HitTestQuery(..) | ReflowGoal::ContentBoxQuery(_) |
- ReflowGoal::ContentBoxesQuery(_) | ReflowGoal::NodeGeometryQuery(_) |
- ReflowGoal::NodeScrollGeometryQuery(_) | ReflowGoal::NodeOverflowQuery(_) |
- ReflowGoal::NodeScrollRootIdQuery(_) | ReflowGoal::ResolvedStyleQuery(..) |
- ReflowGoal::OffsetParentQuery(_) | ReflowGoal::NodesFromPoint(..) => false,
- ReflowGoal::Full | ReflowGoal::TickAnimations => true,
+ ReflowGoal::ContentBoxQuery(_) | ReflowGoal::ContentBoxesQuery(_) |
+ ReflowGoal::NodeGeometryQuery(_) | ReflowGoal::NodeScrollGeometryQuery(_) |
+ ReflowGoal::NodeOverflowQuery(_) | ReflowGoal::NodeScrollRootIdQuery(_) |
+ ReflowGoal::ResolvedStyleQuery(..) |
+ ReflowGoal::OffsetParentQuery(_) => false,
+ ReflowGoal::NodesFromPointQuery(..) | ReflowGoal::Full |
+ ReflowGoal::TickAnimations => true,
}
}
}