mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Fix transform assertion failures in Layout 2013 and Layout 2020 (#30713)
Layout asserts that it never creates stacking contexts that have a zero scale, yet it doesn't prevent the creation of those stacking contexts. This change stops their creation at an earlier stage. Fixes #30118.
This commit is contained in:
parent
1915032f66
commit
72cb34dc3d
8 changed files with 19 additions and 17 deletions
|
@ -2760,9 +2760,11 @@ impl Fragment {
|
|||
}
|
||||
|
||||
/// Returns true if this fragment has a transform applied that causes it to take up no space.
|
||||
pub fn has_non_invertible_transform(&self) -> bool {
|
||||
pub fn has_non_invertible_transform_or_zero_scale(&self) -> bool {
|
||||
self.transform_matrix(&Rect::default())
|
||||
.map_or(false, |matrix| !matrix.is_invertible())
|
||||
.map_or(false, |matrix| {
|
||||
!matrix.is_invertible() || matrix.m11 == 0. || matrix.m22 == 0.
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns true if this fragment establishes a new stacking context and false otherwise.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue