mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Forbid accessing the length and percentage parts of a LengthPercentage separately.
This is just not a thing you can do if you have min() / max() / etc, as the min / max value may depend on the percentage basis. Differential Revision: https://phabricator.services.mozilla.com/D60168
This commit is contained in:
parent
e7e6e62ed3
commit
5237d4fac8
1 changed files with 5 additions and 4 deletions
|
@ -1168,10 +1168,11 @@ impl ComputeSquaredDistance for ComputedTransformOperation {
|
|||
// However, dropping percentage makes us impossible to compute
|
||||
// the distance for the percentage-percentage case, but Gecko
|
||||
// uses the same formula, so it's fine for now.
|
||||
let fx = fx.length_component().px();
|
||||
let fy = fy.length_component().px();
|
||||
let tx = tx.length_component().px();
|
||||
let ty = ty.length_component().px();
|
||||
let basis = Length::new(0.);
|
||||
let fx = fx.resolve(basis).px();
|
||||
let fy = fy.resolve(basis).px();
|
||||
let tx = tx.resolve(basis).px();
|
||||
let ty = ty.resolve(basis).px();
|
||||
|
||||
Ok(fx.compute_squared_distance(&tx)? +
|
||||
fy.compute_squared_distance(&ty)? +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue