diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-08-10 18:50:33 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-10 18:50:33 -0500 |
commit | 9b4b94aa755a04d4b9c9703574b01c03ad25a788 (patch) | |
tree | 51b4c9dbb474c24c983a5f59b610470dda1dbee7 /components/layout_thread | |
parent | 0f1a9f109deedfa9c059da1ee7413f0894503fba (diff) | |
parent | 28d7c2dca806301ad324a49da290dc236d384b44 (diff) | |
download | servo-9b4b94aa755a04d4b9c9703574b01c03ad25a788.tar.gz servo-9b4b94aa755a04d4b9c9703574b01c03ad25a788.zip |
Auto merge of #12777 - emilio:hit-test, r=pcwalton
layout: Take into account the client point for fixed positioned stacking contexts
<!-- 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 #12763 (github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- 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/12777)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout_thread')
-rw-r--r-- | components/layout_thread/lib.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index 958a2acc71e..c31e2de54ac 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1038,7 +1038,7 @@ impl LayoutThread { ReflowQueryType::ContentBoxesQuery(_) => { rw_data.content_boxes_response = Vec::new(); }, - ReflowQueryType::HitTestQuery(_, _) => { + ReflowQueryType::HitTestQuery(..) => { rw_data.hit_test_response = (None, false); }, ReflowQueryType::NodeGeometryQuery(_) => { @@ -1202,12 +1202,21 @@ impl LayoutThread { let node = unsafe { ServoLayoutNode::new(&node) }; rw_data.content_boxes_response = process_content_boxes_request(node, &mut root_flow); }, - ReflowQueryType::HitTestQuery(point, update_cursor) => { - let point = Point2D::new(Au::from_f32_px(point.x), Au::from_f32_px(point.y)); + ReflowQueryType::HitTestQuery(translated_point, client_point, update_cursor) => { + let translated_point = + Point2D::new(Au::from_f32_px(translated_point.x), + Au::from_f32_px(translated_point.y)); + + let client_point = + Point2D::new(Au::from_f32_px(client_point.x), + Au::from_f32_px(client_point.y)); + let result = rw_data.display_list .as_ref() .expect("Tried to hit test with no display list") - .hit_test(&point, &rw_data.stacking_context_scroll_offsets); + .hit_test(&translated_point, + &client_point, + &rw_data.stacking_context_scroll_offsets); rw_data.hit_test_response = (result.last().cloned(), update_cursor); }, ReflowQueryType::NodeGeometryQuery(node) => { |