mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Make CalcNode the specified representation of <length> and <length-percentage> values.
This is the meat of the patch. There are a couple improvements done in a couple later patches which should hopefully be straight-forward. Differential Revision: https://phabricator.services.mozilla.com/D63397
This commit is contained in:
parent
426edbd991
commit
7e8dbd0896
9 changed files with 320 additions and 385 deletions
|
@ -295,10 +295,8 @@ impl<S: Side> ToComputedValue for PositionComponent<S> {
|
|||
},
|
||||
PositionComponent::Side(ref keyword, Some(ref length)) if !keyword.is_start() => {
|
||||
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::new_calc(l, Some(p), AllowedNumericType::All)
|
||||
ComputedLengthPercentage::hundred_percent_minus(length, AllowedNumericType::All)
|
||||
},
|
||||
PositionComponent::Side(_, Some(ref length)) |
|
||||
PositionComponent::Length(ref length) => length.to_computed_value(context),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue