style: Move LengthPercentage to its own file.

I'm (sadly) about to make it a bit more complicated to pack it better. So we
may as well do this so it is easier to reason about navigate.

I also reordered things a bit, and removed some From<> implementations and
such.

Differential Revision: https://phabricator.services.mozilla.com/D58701
This commit is contained in:
Emilio Cobos Álvarez 2020-01-13 13:23:44 +00:00
parent 61f3ff1de3
commit 4d5bd94a2b
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
5 changed files with 566 additions and 568 deletions

View file

@ -297,7 +297,7 @@ impl<S: Side> ToComputedValue for PositionComponent<S> {
let p = Percentage(1. - length.percentage());
let l = -length.unclamped_length();
// We represent `<end-side> <length>` as `calc(100% - <length>)`.
ComputedLengthPercentage::new_calc(l, p)
ComputedLengthPercentage::new_calc(l, Some(p))
},
PositionComponent::Side(_, Some(ref length)) |
PositionComponent::Length(ref length) => length.to_computed_value(context),