style: Make @font-face and @counter-style serialization closer other browsers and style rules.

Style rules serialize on one line and so should @font-face blocks.

Part of https://github.com/w3c/csswg-drafts/issues/4828.

Differential Revision: https://phabricator.services.mozilla.com/D89302
This commit is contained in:
Emilio Cobos Álvarez 2020-09-05 00:42:43 +00:00
parent 74c449c04c
commit cd7619dbf6
2 changed files with 11 additions and 8 deletions

View file

@ -232,12 +232,12 @@ macro_rules! counter_style_descriptors {
fn to_css(&self, _guard: &SharedRwLockReadGuard, dest: &mut CssStringWriter) -> fmt::Result {
dest.write_str("@counter-style ")?;
self.name.to_css(&mut CssWriter::new(dest))?;
dest.write_str(" {\n")?;
dest.write_str(" { ")?;
$(
if let Some(ref value) = self.$ident {
dest.write_str(concat!(" ", $name, ": "))?;
dest.write_str(concat!($name, ": "))?;
ToCss::to_css(value, &mut CssWriter::new(dest))?;
dest.write_str(";\n")?;
dest.write_str("; ")?;
}
)+
dest.write_str("}")