Auto merge of #18086 - BorisChiou:stylo/transform/distance, r=nox,birtles

stylo: Bug 1362896 - Implement ComputeSquaredDistance for TransformList

We implement ComputeSquaredDistance for TransformList.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1362896](https://bugzilla.mozilla.org/show_bug.cgi?id=1362896).
- [X] These changes do not require tests because Gecko has related tests.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18086)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-18 02:24:33 -05:00 committed by GitHub
commit 494dcd7e52
2 changed files with 266 additions and 29 deletions

View file

@ -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())?,
)
}