mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Serialize <overflow-position> before other align bits.
Otherwise the serialisation wouldn't roundtrip with the new syntax, which fixes the position of <overflow-position>. Also make Servo and Gecko agree on whether to serialize "unsafe". Bug: 1430817 MozReview-Commit-ID: L3GSMk5pZ3F
This commit is contained in:
parent
64c514ac3a
commit
0aee33081f
1 changed files with 9 additions and 11 deletions
|
@ -75,7 +75,14 @@ impl ToCss for AlignFlags {
|
||||||
where
|
where
|
||||||
W: Write,
|
W: Write,
|
||||||
{
|
{
|
||||||
let s = match *self & !AlignFlags::FLAG_BITS {
|
match *self & AlignFlags::FLAG_BITS {
|
||||||
|
AlignFlags::LEGACY => dest.write_str("legacy ")?,
|
||||||
|
AlignFlags::SAFE => dest.write_str("safe ")?,
|
||||||
|
// Don't serialize "unsafe", since it's the default.
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
|
||||||
|
dest.write_str(match *self & !AlignFlags::FLAG_BITS {
|
||||||
AlignFlags::AUTO => "auto",
|
AlignFlags::AUTO => "auto",
|
||||||
AlignFlags::NORMAL => "normal",
|
AlignFlags::NORMAL => "normal",
|
||||||
AlignFlags::START => "start",
|
AlignFlags::START => "start",
|
||||||
|
@ -94,16 +101,7 @@ impl ToCss for AlignFlags {
|
||||||
AlignFlags::SPACE_AROUND => "space-around",
|
AlignFlags::SPACE_AROUND => "space-around",
|
||||||
AlignFlags::SPACE_EVENLY => "space-evenly",
|
AlignFlags::SPACE_EVENLY => "space-evenly",
|
||||||
_ => unreachable!()
|
_ => unreachable!()
|
||||||
};
|
})
|
||||||
dest.write_str(s)?;
|
|
||||||
|
|
||||||
match *self & AlignFlags::FLAG_BITS {
|
|
||||||
AlignFlags::LEGACY => { dest.write_str(" legacy")?; }
|
|
||||||
AlignFlags::SAFE => { dest.write_str(" safe")?; }
|
|
||||||
AlignFlags::UNSAFE => { dest.write_str(" unsafe")?; }
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue