style: Fix @import serialization order

Fixed @import serialization being out of (spec) order.

Also added some more WPT tests.

Differential Revision: https://phabricator.services.mozilla.com/D176182
This commit is contained in:
CanadaHonk 2023-04-21 21:09:39 +00:00 committed by Martin Robinson
parent 5d59674c8a
commit 0c246b0b7c

View file

@ -253,6 +253,11 @@ impl ToCssWithGuard for ImportRule {
dest.write_str("@import ")?;
self.url.to_css(&mut CssWriter::new(dest))?;
if let Some(ref layer) = self.layer {
dest.write_char(' ')?;
layer.to_css(&mut CssWriter::new(dest))?;
}
if let Some(ref supports) = self.supports {
dest.write_str(" supports(")?;
supports.condition.to_css(&mut CssWriter::new(dest))?;
@ -266,11 +271,6 @@ impl ToCssWithGuard for ImportRule {
}
}
if let Some(ref layer) = self.layer {
dest.write_char(' ')?;
layer.to_css(&mut CssWriter::new(dest))?;
}
dest.write_char(';')
}
}