mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Properly track whether <angle> or <time> values came from calc() expressions.
This commit is contained in:
parent
c654c05884
commit
fc72f096a0
10 changed files with 281 additions and 90 deletions
|
@ -36,7 +36,6 @@ use values::computed::{CalcLengthOrPercentage, Context, LengthOrPercentage};
|
|||
use values::computed::{MaxLength, MinLength};
|
||||
use values::computed::position::{HorizontalPosition, Position, VerticalPosition};
|
||||
use values::computed::ToComputedValue;
|
||||
use values::specified::Angle as SpecifiedAngle;
|
||||
|
||||
|
||||
|
||||
|
@ -455,7 +454,7 @@ impl Interpolate for i32 {
|
|||
impl Interpolate for Angle {
|
||||
#[inline]
|
||||
fn interpolate(&self, other: &Angle, progress: f64) -> Result<Self, ()> {
|
||||
self.radians().interpolate(&other.radians(), progress).map(Angle)
|
||||
self.radians().interpolate(&other.radians(), progress).map(Angle::from_radians)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -952,7 +951,7 @@ fn build_identity_transform_list(list: &[TransformOperation]) -> Vec<TransformOp
|
|||
result.push(TransformOperation::Matrix(identity));
|
||||
}
|
||||
TransformOperation::Skew(..) => {
|
||||
result.push(TransformOperation::Skew(Angle(0.0), Angle(0.0)));
|
||||
result.push(TransformOperation::Skew(Angle::zero(), Angle::zero()))
|
||||
}
|
||||
TransformOperation::Translate(..) => {
|
||||
result.push(TransformOperation::Translate(LengthOrPercentage::zero(),
|
||||
|
@ -963,7 +962,7 @@ fn build_identity_transform_list(list: &[TransformOperation]) -> Vec<TransformOp
|
|||
result.push(TransformOperation::Scale(1.0, 1.0, 1.0));
|
||||
}
|
||||
TransformOperation::Rotate(..) => {
|
||||
result.push(TransformOperation::Rotate(0.0, 0.0, 1.0, Angle(0.0)));
|
||||
result.push(TransformOperation::Rotate(0.0, 0.0, 1.0, Angle::zero()));
|
||||
}
|
||||
TransformOperation::Perspective(..) => {
|
||||
// http://dev.w3.org/csswg/css-transforms/#identity-transform-function
|
||||
|
@ -1052,7 +1051,7 @@ fn interpolate_transform_list(from_list: &[TransformOperation],
|
|||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transforms/#Rotate3dDefined
|
||||
fn rotate_to_matrix(x: f32, y: f32, z: f32, a: SpecifiedAngle) -> ComputedMatrix {
|
||||
fn rotate_to_matrix(x: f32, y: f32, z: f32, a: Angle) -> ComputedMatrix {
|
||||
let half_rad = a.radians() / 2.0;
|
||||
let sc = (half_rad).sin() * (half_rad).cos();
|
||||
let sq = (half_rad).sin().powi(2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue