Align serialization of keyframes rule with Gecko. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Wed, 17 May 2017 17:25:28 +1000
changeset 579920 782fb1046e96de33ebfd1e19fbcd4e2a8e803714
parent 579919 fbe234d5ddd59aab5ae8f85cd0593550ef52aa87
child 579921 b74deab9ee7c59fd6a0455f0cb8b7b2bb146ce44
push id59406
push userxquan@mozilla.com
push dateThu, 18 May 2017 00:25:34 +0000
reviewersheycam
milestone55.0a1
Align serialization of keyframes rule with Gecko. r?heycam MozReview-Commit-ID: B4XuRpacI2q
servo/components/style/stylesheets.rs
--- a/servo/components/style/stylesheets.rs
+++ b/servo/components/style/stylesheets.rs
@@ -570,28 +570,24 @@ pub struct KeyframesRule {
 }
 
 impl ToCssWithGuard for KeyframesRule {
     // Serialization of KeyframesRule is not specced.
     fn to_css<W>(&self, guard: &SharedRwLockReadGuard, dest: &mut W) -> fmt::Result
     where W: fmt::Write {
         try!(dest.write_str("@keyframes "));
         try!(self.name.to_css(dest));
-        try!(dest.write_str(" { "));
+        try!(dest.write_str(" {"));
         let iter = self.keyframes.iter();
-        let mut first = true;
         for lock in iter {
-            if !first {
-                try!(dest.write_str(" "));
-            }
-            first = false;
+            try!(dest.write_str("\n"));
             let keyframe = lock.read_with(&guard);
             try!(keyframe.to_css(guard, dest));
         }
-        dest.write_str(" }")
+        dest.write_str("\n}")
     }
 }
 
 #[allow(missing_docs)]
 #[derive(Debug)]
 pub struct MediaRule {
     pub media_queries: Arc<Locked<MediaList>>,
     pub rules: Arc<Locked<CssRules>>,