diff --git a/components/style/values/specified/calc.rs b/components/style/values/specified/calc.rs index 200a6db1d0a..745a46fd43f 100644 --- a/components/style/values/specified/calc.rs +++ b/components/style/values/specified/calc.rs @@ -245,7 +245,7 @@ impl generic::CalcNodeLeaf for Leaf { *a = Angle::from_calc(a.degrees() * scalar); }, Self::Time(ref mut t) => { - *t = Time::from_calc(t.seconds() * scalar); + *t = Time::from_seconds(t.seconds() * scalar); }, Self::Percentage(ref mut p) => { *p *= scalar; @@ -334,7 +334,7 @@ impl generic::CalcNodeLeaf for Leaf { *one = specified::Angle::from_calc(one.degrees() + other.degrees()); }, (&mut Time(ref mut one), &Time(ref other)) => { - *one = specified::Time::from_calc(one.seconds() + other.seconds()); + *one = specified::Time::from_seconds(one.seconds() + other.seconds()); }, (&mut Length(ref mut one), &Length(ref other)) => { *one = one.try_op(other, std::ops::Add::add)?; @@ -376,7 +376,7 @@ impl generic::CalcNodeLeaf for Leaf { )))); }, (&Time(ref one), &Time(ref other)) => { - return Ok(Leaf::Time(specified::Time::from_calc(op( + return Ok(Leaf::Time(specified::Time::from_seconds(op( one.seconds(), other.seconds(), )))); @@ -428,7 +428,7 @@ impl CalcNode { } } if allowed_units.intersects(CalcUnits::TIME) { - if let Ok(t) = Time::parse_dimension(value, unit, /* from_calc = */ true) { + if let Ok(t) = Time::parse_dimension(value, unit) { return Ok(CalcNode::Leaf(Leaf::Time(t))); } } @@ -596,8 +596,8 @@ impl CalcNode { return Ok(a.atan2(b)); } - if let Ok(a) = a.to_time() { - let b = b.to_time()?; + if let Ok(a) = a.to_time(None) { + let b = b.to_time(None)?; return Ok(a.seconds().atan2(b.seconds())); } @@ -822,12 +822,21 @@ impl CalcNode { } /// Tries to simplify this expression into a `