style: Split LengthPercentage again.

This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

Differential Revision: https://phabricator.services.mozilla.com/D58700
This commit is contained in:
Emilio Cobos Álvarez 2020-01-13 13:21:58 +00:00
parent ec37e7a5b8
commit 61f3ff1de3
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
6 changed files with 304 additions and 177 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::with_clamping_mode(l, Some(p), length.clamping_mode)
ComputedLengthPercentage::new_calc(l, p)
},
PositionComponent::Side(_, Some(ref length)) |
PositionComponent::Length(ref length) => length.to_computed_value(context),