mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Add some parsing and serialization tests for @layer
This uncovers some serialization bugs, and some missing null-checks given the statement layer doesn't have a rule list. Differential Revision: https://phabricator.services.mozilla.com/D125176
This commit is contained in:
parent
35bf5f0b09
commit
5fe148d5f1
1 changed files with 5 additions and 3 deletions
|
@ -234,7 +234,7 @@ impl ToCssWithGuard for LayerRule {
|
|||
guard: &SharedRwLockReadGuard,
|
||||
dest: &mut crate::str::CssStringWriter,
|
||||
) -> fmt::Result {
|
||||
dest.write_str("@layer ")?;
|
||||
dest.write_str("@layer")?;
|
||||
match self.kind {
|
||||
LayerRuleKind::Block {
|
||||
ref name,
|
||||
|
@ -242,8 +242,8 @@ impl ToCssWithGuard for LayerRule {
|
|||
ref is_anonymous,
|
||||
} => {
|
||||
if !*is_anonymous {
|
||||
name.to_css(&mut CssWriter::new(dest))?;
|
||||
dest.write_char(' ')?;
|
||||
name.to_css(&mut CssWriter::new(dest))?;
|
||||
}
|
||||
rules.read_with(guard).to_css_block(guard, dest)
|
||||
},
|
||||
|
@ -251,7 +251,9 @@ impl ToCssWithGuard for LayerRule {
|
|||
let mut writer = CssWriter::new(dest);
|
||||
let mut first = true;
|
||||
for name in &**names {
|
||||
if !first {
|
||||
if first {
|
||||
writer.write_char(' ')?;
|
||||
} else {
|
||||
writer.write_str(", ")?;
|
||||
}
|
||||
first = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue