mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Revert "Include the scrollable overflow of a child box if either its parent or child has overflow: visible
(#38443)" (#38546)
This reverts commit dcb90bb85e
.
This broke scrollable overflow calculation in the following case:
```
<div id="foo" style="width: 200px; height: 200px; outline: solid; overflow: auto;">
<div style="height: 5000px; background: pink;">hello</div>
</div>
```
In this case the overflow is propagating through the `overflow: auto`
`<div>` and into the parents. When dumping the flow tree I see the root
node being 5000 pixels tall. It's unclear why this change didn't break
any tests, so it's likely that we need to add a test for this case.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
5c307a38df
commit
4257db643b
5 changed files with 55 additions and 51 deletions
|
@ -15,7 +15,6 @@ use super::{BoxFragment, ContainingBlockManager, Fragment};
|
|||
use crate::ArcRefCell;
|
||||
use crate::context::LayoutContext;
|
||||
use crate::geom::PhysicalRect;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
|
||||
#[derive(MallocSizeOf)]
|
||||
pub struct FragmentTree {
|
||||
|
@ -118,15 +117,8 @@ impl FragmentTree {
|
|||
let scrollable_overflow = self.root_fragments.iter().fold(
|
||||
self.initial_containing_block,
|
||||
|overflow, fragment| {
|
||||
let overflow_style = match fragment {
|
||||
Fragment::Box(fragment) | Fragment::Float(fragment) => {
|
||||
let fragment_flags = fragment.borrow().base.flags;
|
||||
Some(fragment.borrow().style.effective_overflow(fragment_flags))
|
||||
},
|
||||
_ => None,
|
||||
};
|
||||
fragment
|
||||
.calculate_scrollable_overflow_for_parent(overflow_style)
|
||||
.calculate_scrollable_overflow_for_parent()
|
||||
.union(&overflow)
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue