mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Keep the unit of the serialization of specified::CalcLengthOrPercentage.
For the serialization of specified values of calc(), we should keep the units of absolute lengths, so use AbsoluteLength.
This commit is contained in:
parent
5defc56ad5
commit
6607103f94
3 changed files with 61 additions and 14 deletions
|
@ -223,7 +223,7 @@ impl specified::CalcLengthOrPercentage {
|
|||
let mut length = Au(0);
|
||||
|
||||
if let Some(absolute) = self.absolute {
|
||||
length += zoom_fn(absolute);
|
||||
length += zoom_fn(absolute.to_computed_value(context));
|
||||
}
|
||||
|
||||
for val in &[self.vw.map(ViewportPercentageLength::Vw),
|
||||
|
@ -269,7 +269,7 @@ impl ToComputedValue for specified::CalcLengthOrPercentage {
|
|||
fn from_computed_value(computed: &CalcLengthOrPercentage) -> Self {
|
||||
specified::CalcLengthOrPercentage {
|
||||
clamping_mode: computed.clamping_mode,
|
||||
absolute: Some(computed.length),
|
||||
absolute: Some(AbsoluteLength::from_computed_value(&computed.length)),
|
||||
percentage: computed.percentage,
|
||||
..Default::default()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue