Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylo: Bug 1362896 - Implement ComputeSquaredDistance for TransformList #18086

Merged
merged 4 commits into from Aug 18, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Tweak CalcLengthOrPercentage to use pixel value.

We compute the distance for eCSSUnit_Calc by pixel value in Gecko,
so let's follow the same rules.
  • Loading branch information
BorisChiou committed Aug 17, 2017
commit a5433ad68a26bcf410a5c6784f0a38652e0d677b
@@ -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())? +

This comment has been minimized.

@nox

nox Aug 16, 2017

Member

Why is it correct at all to mix lengths and percentages? Cf. the FIXME I left just above that change.

This comment has been minimized.

@BorisChiou

BorisChiou Aug 17, 2017

Author Contributor

Actually, this doesn't make any sense. However, while computing the distance or doing interpolation, we only have computed values (i.e. we shouldn't use used values), so this is a temporary? way to define its distance, and the test cases in Gecko use this way to produce the expected values.
We should keep the "FIXME:" because I hope one day we could use a better way to define the distance.

This comment has been minimized.

@nox

nox Aug 17, 2017

Member

Ok.

self.percentage().compute_squared_distance(&other.percentage())?,
)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.