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
|
@ -23,7 +23,7 @@ use super::{
|
|||
use crate::cell::ArcRefCell;
|
||||
use crate::flow::inline::SharedInlineStyles;
|
||||
use crate::geom::{LogicalSides, PhysicalPoint, PhysicalRect};
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::style_ext::{AxesOverflow, ComputedValuesExt};
|
||||
|
||||
#[derive(Clone, MallocSizeOf)]
|
||||
pub(crate) enum Fragment {
|
||||
|
@ -168,14 +168,19 @@ impl Fragment {
|
|||
let fragment = fragment.borrow();
|
||||
fragment.offset_by_containing_block(&fragment.scrollable_overflow())
|
||||
},
|
||||
_ => self.scrollable_overflow_for_parent(),
|
||||
_ => self.scrollable_overflow_for_parent(None),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn scrollable_overflow_for_parent(&self) -> PhysicalRect<Au> {
|
||||
pub(crate) fn scrollable_overflow_for_parent(
|
||||
&self,
|
||||
parent_overflow_style: Option<AxesOverflow>,
|
||||
) -> PhysicalRect<Au> {
|
||||
match self {
|
||||
Fragment::Box(fragment) | Fragment::Float(fragment) => {
|
||||
return fragment.borrow().scrollable_overflow_for_parent();
|
||||
return fragment
|
||||
.borrow()
|
||||
.scrollable_overflow_for_parent(parent_overflow_style);
|
||||
},
|
||||
Fragment::AbsoluteOrFixedPositioned(_) => PhysicalRect::zero(),
|
||||
Fragment::Positioning(fragment) => fragment.borrow().scrollable_overflow_for_parent(),
|
||||
|
@ -185,9 +190,12 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn calculate_scrollable_overflow_for_parent(&self) -> PhysicalRect<Au> {
|
||||
pub(crate) fn calculate_scrollable_overflow_for_parent(
|
||||
&self,
|
||||
parent_overflow_style: Option<AxesOverflow>,
|
||||
) -> PhysicalRect<Au> {
|
||||
self.calculate_scrollable_overflow();
|
||||
self.scrollable_overflow_for_parent()
|
||||
self.scrollable_overflow_for_parent(parent_overflow_style)
|
||||
}
|
||||
|
||||
pub(crate) fn calculate_scrollable_overflow(&self) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue