mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Include transform changes in list that cause incremental reflows.
Also ensure that 3d translations get layers. Fixes #8329.
This commit is contained in:
parent
f17f89059a
commit
f555e3861c
3 changed files with 40 additions and 29 deletions
|
@ -55,7 +55,7 @@ use std::cmp::{max, min};
|
|||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
use style::computed_values::{border_collapse, box_sizing, display, float, overflow_x, overflow_y};
|
||||
use style::computed_values::{position, text_align, transform, transform_style};
|
||||
use style::computed_values::{position, text_align, transform_style};
|
||||
use style::properties::ComputedValues;
|
||||
use style::values::computed::{LengthOrNone, LengthOrPercentageOrNone};
|
||||
use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
||||
|
@ -585,33 +585,6 @@ impl BlockFlow {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn transform_requires_layer(&self) -> bool {
|
||||
// Check if the transform matrix is 2D or 3D
|
||||
if let Some(ref transform_list) = self.fragment.style().get_effects().transform.0 {
|
||||
for transform in transform_list {
|
||||
match *transform {
|
||||
transform::ComputedOperation::Perspective(..) => {
|
||||
return true;
|
||||
}
|
||||
transform::ComputedOperation::Matrix(m) => {
|
||||
// See http://dev.w3.org/csswg/css-transforms/#2d-matrix
|
||||
if m.m31 != 0.0 || m.m32 != 0.0 ||
|
||||
m.m13 != 0.0 || m.m23 != 0.0 ||
|
||||
m.m43 != 0.0 || m.m14 != 0.0 ||
|
||||
m.m24 != 0.0 || m.m34 != 0.0 ||
|
||||
m.m33 != 1.0 || m.m44 != 1.0 {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Neither perspective nor transform present
|
||||
false
|
||||
}
|
||||
|
||||
/// Compute the actual inline size and position for this block.
|
||||
pub fn compute_used_inline_size(&mut self,
|
||||
layout_context: &LayoutContext,
|
||||
|
@ -1560,7 +1533,7 @@ impl BlockFlow {
|
|||
|
||||
// This flow needs a layer if it has a 3d transform, or provides perspective
|
||||
// to child layers. See http://dev.w3.org/csswg/css-transforms/#3d-rendering-contexts.
|
||||
let has_3d_transform = self.transform_requires_layer();
|
||||
let has_3d_transform = self.fragment.style().transform_requires_layer();
|
||||
let has_perspective = self.fragment.style().get_effects().perspective !=
|
||||
LengthOrNone::None;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue