mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
Include the scrollable overflow of a child box if either its parent or child has overflow: visible
(#38443)
Include the scrollable overflow of a child box if either its parent or child has `overflow: visible` **Issue**: For the blocks having property `overflow:hidden`, their scroll overflow is not added to parent's scroll overflow. Causing unable to scroll the parent block aka `Root` block in our Issue #38248 . **Testing**: css/cssom-view/scrolling-quirks-vs-nonquirks.html **Fixes**: #38248 Signed-off-by: Shubham Gupta <shubham13297@gmail.com>
This commit is contained in:
parent
5b148cf5de
commit
dcb90bb85e
5 changed files with 51 additions and 55 deletions
|
@ -15,6 +15,7 @@ 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 {
|
||||
|
@ -117,8 +118,15 @@ 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()
|
||||
.calculate_scrollable_overflow_for_parent(overflow_style)
|
||||
.union(&overflow)
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue