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:
Emilio Cobos Álvarez 2018-01-24 18:13:53 +01:00
parent 64c514ac3a
commit 0aee33081f
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -75,7 +75,14 @@ impl ToCss for AlignFlags {
where
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::NORMAL => "normal",
AlignFlags::START => "start",
@ -94,16 +101,7 @@ impl ToCss for AlignFlags {
AlignFlags::SPACE_AROUND => "space-around",
AlignFlags::SPACE_EVENLY => "space-evenly",
_ => 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(())
})
}
}