diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-05-28 18:50:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-28 18:50:18 -0400 |
commit | 7cc4165ddad9b76bf35e1a6fb115c00eefe4a00f (patch) | |
tree | 79b64e94dcd094adccf3929fabb541c8040bfc06 | |
parent | 2439ab02b8e021836ff620ef473e556adaa66d58 (diff) | |
parent | 423d417dd7ae98cb95dfc1f0e45d4343ee2b467d (diff) | |
download | servo-7cc4165ddad9b76bf35e1a6fb115c00eefe4a00f.tar.gz servo-7cc4165ddad9b76bf35e1a6fb115c00eefe4a00f.zip |
Auto merge of #20868 - tigercosmos:gg1, r=emilio
fix logic in overflow_direction, also add a FIXME
<!-- Please describe your changes on the following line: -->
This PR fix #19477, which the logic is obviously wrong.
However, it is impossible to add a test for this.
Due to #20867, the ` overflow_direction` is a hard code now. It never go to other conditions.
I add a FIXME there, and also add a SPEC link.
---
<!-- 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 #19477(github issue number if applicable).
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- 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/20868)
<!-- Reviewable:end -->
-rw-r--r-- | components/layout/query.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/components/layout/query.rs b/components/layout/query.rs index 969f27249e4..b52d415939f 100644 --- a/components/layout/query.rs +++ b/components/layout/query.rs @@ -393,6 +393,7 @@ impl UnioningFragmentScrollAreaIterator { origin_rect: Rect::zero(), level: None, is_child: false, + // FIXME(#20867) overflow_direction: OverflowDirection::RightAndDown } } @@ -634,6 +635,7 @@ pub fn process_node_scroll_id_request<N: LayoutNode>( layout_node.generate_scroll_id(id) } +/// https://drafts.csswg.org/cssom-view/#scrolling-area pub fn process_node_scroll_area_request< N: LayoutNode>(requested_node: N, layout_root: &mut Flow) -> Rect<i32> { let mut iterator = UnioningFragmentScrollAreaIterator::new(requested_node.opaque()); @@ -646,7 +648,7 @@ pub fn process_node_scroll_area_request< N: LayoutNode>(requested_node: N, layou }, OverflowDirection::LeftAndDown => { let bottom = max(iterator.union_rect.size.height, iterator.origin_rect.size.height); - let left = max(iterator.union_rect.origin.x, iterator.origin_rect.origin.x); + let left = min(iterator.union_rect.origin.x, iterator.origin_rect.origin.x); Rect::new(Point2D::new(left, iterator.origin_rect.origin.y), Size2D::new(iterator.origin_rect.size.width, bottom)) }, |