mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Serialize percentages first in specified calc() expressions.
This commit is contained in:
parent
f8a6eccda2
commit
e05c673df3
1 changed files with 7 additions and 5 deletions
|
@ -125,6 +125,13 @@ impl ToCss for CalcLengthOrPercentage {
|
||||||
|
|
||||||
dest.write_str("calc(")?;
|
dest.write_str("calc(")?;
|
||||||
|
|
||||||
|
// NOTE(emilio): Percentages first because of web-compat problems, see:
|
||||||
|
// https://github.com/w3c/csswg-drafts/issues/1731
|
||||||
|
if let Some(val) = self.percentage {
|
||||||
|
first_value_check!(val.0);
|
||||||
|
val.abs().to_css(dest)?;
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE(emilio): The order here it's very intentional, and alphabetic
|
// NOTE(emilio): The order here it's very intentional, and alphabetic
|
||||||
// per the spec linked above.
|
// per the spec linked above.
|
||||||
serialize!(ch, em, ex);
|
serialize!(ch, em, ex);
|
||||||
|
@ -143,11 +150,6 @@ impl ToCss for CalcLengthOrPercentage {
|
||||||
|
|
||||||
serialize!(rem, vh, vmax, vmin, vw);
|
serialize!(rem, vh, vmax, vmin, vw);
|
||||||
|
|
||||||
if let Some(val) = self.percentage {
|
|
||||||
first_value_check!(val.0);
|
|
||||||
val.abs().to_css(dest)?;
|
|
||||||
}
|
|
||||||
|
|
||||||
dest.write_str(")")
|
dest.write_str(")")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue