style: Three-value position syntax uses calc() as its computed value representation.

This restores the previous behavior of using calc().

Note that background-position / object-position, which test this, weren't
hitting the assertion because they use another codepath.

I didn't add more extensive tests for this because it's well tested for those
two properties, and because this is legacy anyway, see the comment in the test.

I did add the assertion to the codepath those two properties hit.

Differential Revision: https://phabricator.services.mozilla.com/D16176
This commit is contained in:
Emilio Cobos Álvarez 2019-01-11 01:07:22 +01:00
parent 119b316885
commit 99f6d6f1b8
2 changed files with 8 additions and 2 deletions

View file

@ -263,11 +263,12 @@ impl<S: Side> ToComputedValue for PositionComponent<S> {
let length = length.to_computed_value(context);
let p = Percentage(1. - length.percentage());
let l = -length.unclamped_length();
// We represent `<end-side> <length>` as `calc(100% - <length>)`.
ComputedLengthPercentage::with_clamping_mode(
l,
Some(p),
length.clamping_mode,
length.was_calc,
/* was_calc = */ true,
)
},
PositionComponent::Side(_, Some(ref length)) |