diff --git a/components/style/values/computed/length.rs b/components/style/values/computed/length.rs index fbe3b56e724..402ec36552a 100644 --- a/components/style/values/computed/length.rs +++ b/components/style/values/computed/length.rs @@ -78,7 +78,8 @@ impl ComputeSquaredDistance for CalcLengthOrPercentage { // FIXME(nox): This looks incorrect to me, to add a distance between lengths // with a distance between percentages. Ok( - self.unclamped_length().compute_squared_distance(&other.unclamped_length())? + + self.unclamped_length().to_f64_px().compute_squared_distance( + &other.unclamped_length().to_f64_px())? + self.percentage().compute_squared_distance(&other.percentage())?, ) }