mirror of
https://github.com/servo/servo.git
synced 2025-09-03 19:48:21 +01:00
layout: Unify scrollable overflow calculation and include position: absolute
(#37475)
Previously, layout was handling scrollable overflow and srolling area calculation separately, only excluding the "unreachable scrollable overflow region" at the last step. In addition, `position: absolute` was not included in scrollable overflow calculation. This change combines the two concepts into a single scrollable overflow calculation and starts taking into account `position: absolute`. Finally, `BoxFragment::scrollable_overflow_for_parent` is converted to use early returns which reduces the amount of indentation. Fixes #35928. Fixes #37204. Testing: This causes some WPT test to pass, but also two to start failing: - `/css/css-masking/clip-path/clip-path-fixed-scroll.html`: This seems to fail because script is scrolling past the boundaries of the document. This is a failure that was uncovered by the fixed element now being added to the page's scroll area. - `/css/css-overflow/overflow-outside-padding.html`: One test has started to fail here because now the absolutely positioned element is included in the scroll area, and I think there is an issue with how we are placing RTL items with negative margins. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
29e618dcf7
commit
0f61361e27
14 changed files with 123 additions and 142 deletions
|
@ -1100,12 +1100,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
|
||||
fn build(&mut self, builder: &mut DisplayListBuilder, section: StackingContextSection) {
|
||||
if self.is_hit_test_for_scrollable_overflow {
|
||||
self.build_hit_test(
|
||||
builder,
|
||||
self.fragment
|
||||
.reachable_scrollable_overflow_region()
|
||||
.to_webrender(),
|
||||
);
|
||||
self.build_hit_test(builder, self.fragment.scrollable_overflow().to_webrender());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1472,12 +1472,10 @@ impl BoxFragment {
|
|||
y: overflow.y.into(),
|
||||
};
|
||||
|
||||
let content_rect = self.reachable_scrollable_overflow_region().to_webrender();
|
||||
|
||||
let scroll_tree_node_id = stacking_context_tree.define_scroll_frame(
|
||||
parent_scroll_node_id,
|
||||
external_id,
|
||||
content_rect,
|
||||
self.scrollable_overflow().to_webrender(),
|
||||
scroll_frame_rect,
|
||||
sensitivity,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue