diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-05-16 08:33:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-16 08:33:22 -0500 |
commit | d855c929ef32e8f7d4bc15ba726e8eb5f8ad8e05 (patch) | |
tree | 0560b84b62664960630a0b21b056c7d2ac80a1e6 /components/script_layout_interface/message.rs | |
parent | 0388e11db2532d41a71e184cb2a1f46e5107b8f5 (diff) | |
parent | 9fd2df5c09a35eef8b0b503dd98579c4b9092e31 (diff) | |
download | servo-d855c929ef32e8f7d4bc15ba726e8eb5f8ad8e05.tar.gz servo-d855c929ef32e8f7d4bc15ba726e8eb5f8ad8e05.zip |
Auto merge of #16865 - mrobinson:scroll-offsets-fix, r=emilio
Properly handle scroll offsets in hit testing
Scroll roots are no longer nested containers holding items, so instead
we need to track the offsets of each, carefully handling fixed position
items and stacking contexts that create new reference frames.
Additionally, we remove the complexity of the pre-computed page scroll
offset, instead opting to send script scrolls to the layout task in
order to more quickly have a ScrollState there that matches the
script's idea of the scroll world.
Fixes #16405.
<!-- 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
- [x] These changes fix #16405.
<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is currently impossible to test interactive scrolling with Servo's test infrastructure. Existing tests verify the script part though.
<!-- 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/16865)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script_layout_interface/message.rs')
-rw-r--r-- | components/script_layout_interface/message.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script_layout_interface/message.rs b/components/script_layout_interface/message.rs index 9c2f94b0dc0..038967fdd04 100644 --- a/components/script_layout_interface/message.rs +++ b/components/script_layout_interface/message.rs @@ -12,8 +12,8 @@ use msg::constellation_msg::PipelineId; use net_traits::image_cache::ImageCache; use profile_traits::mem::ReportsChan; use rpc::LayoutRPC; -use script_traits::{ConstellationControlMsg, LayoutControlMsg, UntrustedNodeAddress}; -use script_traits::{LayoutMsg as ConstellationMsg, StackingContextScrollState, WindowSizeData}; +use script_traits::{ConstellationControlMsg, LayoutControlMsg, LayoutMsg as ConstellationMsg}; +use script_traits::{ScrollState, UntrustedNodeAddress, WindowSizeData}; use servo_url::ServoUrl; use std::sync::Arc; use std::sync::mpsc::{Receiver, Sender}; @@ -79,7 +79,11 @@ pub enum Msg { SetFinalUrl(ServoUrl), /// Tells layout about the new scrolling offsets of each scrollable stacking context. - SetStackingContextScrollStates(Vec<StackingContextScrollState>), + SetScrollStates(Vec<ScrollState>), + + /// Tells layout about a single new scrolling offset from the script. The rest will + /// remain untouched and layout won't forward this back to script. + UpdateScrollStateFromScript(ScrollState), } @@ -90,7 +94,7 @@ pub enum ReflowQueryType { ContentBoxQuery(TrustedNodeAddress), ContentBoxesQuery(TrustedNodeAddress), NodeOverflowQuery(TrustedNodeAddress), - HitTestQuery(Point2D<f32>, Point2D<f32>, bool), + HitTestQuery(Point2D<f32>, bool), NodeScrollRootIdQuery(TrustedNodeAddress), NodeGeometryQuery(TrustedNodeAddress), NodeScrollGeometryQuery(TrustedNodeAddress), @@ -98,7 +102,7 @@ pub enum ReflowQueryType { OffsetParentQuery(TrustedNodeAddress), MarginStyleQuery(TrustedNodeAddress), TextIndexQuery(TrustedNodeAddress, i32, i32), - NodesFromPoint(Point2D<f32>, Point2D<f32>), + NodesFromPoint(Point2D<f32>), } /// Information needed for a reflow. |