Bug 1588431 - Split collect_style_attribute_and_animation_rules. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 13 Nov 2019 09:58:52 +0000
changeset 501904 752fca530835e61a9ba5b1131b91e7d17b1e4564
parent 501903 f01d761796534e46b655e27a634d65ffa5934be9
child 501905 9f62b84d6bbb31cb27a8458946fa9fe4d86c8275
push id114172
push userdluca@mozilla.com
push dateTue, 19 Nov 2019 11:31:10 +0000
treeherdermozilla-inbound@b5c5ba07d3db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1588431
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1588431 - Split collect_style_attribute_and_animation_rules. r=heycam Animations are their own cascade level per https://drafts.csswg.org/css-cascade-4/#cascade-origin Differential Revision: https://phabricator.services.mozilla.com/D52575
servo/components/style/rule_collector.rs
--- a/servo/components/style/rule_collector.rs
+++ b/servo/components/style/rule_collector.rs
@@ -372,25 +372,27 @@ where
                         );
                     }
                 });
             });
             sort_rules_from(rules, start);
         }
     }
 
-    fn collect_style_attribute_and_animation_rules(&mut self) {
+    fn collect_style_attribute(&mut self) {
         if let Some(sa) = self.style_attribute {
             self.rules
                 .push(ApplicableDeclarationBlock::from_declarations(
                     sa.clone_arc(),
                     CascadeLevel::StyleAttributeNormal,
                 ));
         }
+    }
 
+    fn collect_animation_rules(&mut self) {
         if let Some(so) = self.smil_override {
             self.rules
                 .push(ApplicableDeclarationBlock::from_declarations(
                     so.clone_arc(),
                     CascadeLevel::SMILOverride,
                 ));
         }
 
@@ -431,11 +433,12 @@ where
         if self.stylist.author_styles_enabled() == AuthorStylesEnabled::No {
             return;
         }
         self.collect_host_rules();
         self.collect_slotted_rules();
         self.collect_normal_rules_from_containing_shadow_tree();
         self.collect_document_author_rules();
         self.collect_part_rules();
-        self.collect_style_attribute_and_animation_rules();
+        self.collect_style_attribute();
+        self.collect_animation_rules();
     }
 }