mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
fix logic in overflow_direction, also add a FIXME
This commit is contained in:
parent
f6762d54e2
commit
423d417dd7
1 changed files with 3 additions and 1 deletions
|
@ -393,6 +393,7 @@ impl UnioningFragmentScrollAreaIterator {
|
||||||
origin_rect: Rect::zero(),
|
origin_rect: Rect::zero(),
|
||||||
level: None,
|
level: None,
|
||||||
is_child: false,
|
is_child: false,
|
||||||
|
// FIXME(#20867)
|
||||||
overflow_direction: OverflowDirection::RightAndDown
|
overflow_direction: OverflowDirection::RightAndDown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -634,6 +635,7 @@ pub fn process_node_scroll_id_request<N: LayoutNode>(
|
||||||
layout_node.generate_scroll_id(id)
|
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)
|
pub fn process_node_scroll_area_request< N: LayoutNode>(requested_node: N, layout_root: &mut Flow)
|
||||||
-> Rect<i32> {
|
-> Rect<i32> {
|
||||||
let mut iterator = UnioningFragmentScrollAreaIterator::new(requested_node.opaque());
|
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 => {
|
OverflowDirection::LeftAndDown => {
|
||||||
let bottom = max(iterator.union_rect.size.height, iterator.origin_rect.size.height);
|
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),
|
Rect::new(Point2D::new(left, iterator.origin_rect.origin.y),
|
||||||
Size2D::new(iterator.origin_rect.size.width, bottom))
|
Size2D::new(iterator.origin_rect.size.width, bottom))
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue