mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement Servo_ParseTransformIntoMatrix.
DOMMatrix needs to convert a specified transform list into a matrix, so we could rewrite to_transform_3d_matrix by generics for both specified and computed transform lists. Besides, we have to update the test case because we use Transform3D<f64> to compute the matrix, instead of Transform3D<f32>, so the result will be the same as that in Gecko. Using 0.3 may cause floating point issue because (0.3f32 as f64) is not equal to 0.3 (i.e. floating point precision issue), so using 0.25 instead.
This commit is contained in:
parent
ac6e04ebfb
commit
3a38e815ec
16 changed files with 450 additions and 238 deletions
|
@ -63,6 +63,10 @@ pub enum CalcUnit {
|
|||
}
|
||||
|
||||
/// A struct to hold a simplified `<length>` or `<percentage>` expression.
|
||||
///
|
||||
/// In some cases, e.g. DOMMatrix, we support calc(), but reject all the relative lengths, and
|
||||
/// to_computed_pixel_length_without_context() handles this case. Therefore, if you want to add a
|
||||
/// new field, please make sure this function work properly.
|
||||
#[derive(Clone, Copy, Debug, Default, MallocSizeOf, PartialEq)]
|
||||
#[allow(missing_docs)]
|
||||
pub struct CalcLengthOrPercentage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue