mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
layout: Account for transform in scrollable overflow (#36138)
In the scrollable overflow calcutation, apply CSS transforms to boxes and scrollable overflow of the descendant. Clip unreachable scrollable overflow according to it's block start and inline start scrolling direction. And, renamed `Fragment::scrolling_overflow` to `Fragment::scrolling_overflow_for_parent` as it was calculating the scrolling overflow contribution from a child. Add several WPT tests, testing the transform interaction `rotate`, `scale`, and `skew` with scrollable overflow. There are several WPT test that are testing the interaction that not expected from current browsers implementation according to the spec. Testing: Existing and new WPT. Fixes: #36031 --------- Signed-off-by: stevennovaryo <steven.novaryo@gmail.com>
This commit is contained in:
parent
b92542b756
commit
bd6928f3dc
37 changed files with 974 additions and 288 deletions
|
@ -170,17 +170,28 @@ impl Fragment {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn scrolling_area(&self) -> PhysicalRect<Au> {
|
||||
pub fn unclipped_scrolling_area(&self) -> PhysicalRect<Au> {
|
||||
match self {
|
||||
Fragment::Box(fragment) | Fragment::Float(fragment) => {
|
||||
let fragment = fragment.borrow();
|
||||
fragment.offset_by_containing_block(&fragment.scrollable_overflow())
|
||||
},
|
||||
_ => self.scrollable_overflow(),
|
||||
_ => self.scrollable_overflow_for_parent(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn scrollable_overflow(&self) -> PhysicalRect<Au> {
|
||||
pub fn scrolling_area(&self) -> PhysicalRect<Au> {
|
||||
match self {
|
||||
Fragment::Box(fragment) | Fragment::Float(fragment) => {
|
||||
let fragment = fragment.borrow();
|
||||
fragment
|
||||
.offset_by_containing_block(&fragment.reachable_scrollable_overflow_region())
|
||||
},
|
||||
_ => self.scrollable_overflow_for_parent(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn scrollable_overflow_for_parent(&self) -> PhysicalRect<Au> {
|
||||
match self {
|
||||
Fragment::Box(fragment) | Fragment::Float(fragment) => {
|
||||
fragment.borrow().scrollable_overflow_for_parent()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue