Bug 1311257 - Make cascade_with_rules take SharedStyleContext instead StyleContext. r?heycam draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Wed, 05 Apr 2017 08:34:37 +0900
changeset 555841 0d3d94b4241cc8427275b5d64d51d6e73be8051f
parent 555840 308b4f1425ed9cb1bbcd1accafcc2bd18e4b7bfb
child 555842 3665b3a711c6d76048207da61644686c290c55da
push id52367
push userhikezoe@mozilla.com
push dateWed, 05 Apr 2017 02:18:23 +0000
reviewersheycam
bugs1311257
milestone55.0a1
Bug 1311257 - Make cascade_with_rules take SharedStyleContext instead StyleContext. r?heycam MozReview-Commit-ID: CsLfQcmBhLM
servo/components/style/matching.rs
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -465,23 +465,22 @@ trait PrivateMatchMethods: TElement {
 
             if !is_display_contents {
                 return current;
             }
         }
     }
 
     fn cascade_with_rules(&self,
-                          context: &StyleContext<Self>,
+                          shared_context: &SharedStyleContext,
                           rule_node: &StrongRuleNode,
                           primary_style: &ComputedStyle,
                           pseudo_style: &Option<(&PseudoElement, &mut ComputedStyle)>,
                           cascade_flags: CascadeFlags)
                           -> Arc<ComputedValues> {
-        let shared_context = context.shared;
         let mut cascade_info = CascadeInfo::new();
 
         // Grab the inherited values.
         let parent_el;
         let parent_data;
         let inherited_values_ = if pseudo_style.is_none() {
             parent_el = self.parent_element();
             parent_data = parent_el.as_ref().and_then(|e| e.borrow_data());
@@ -554,17 +553,17 @@ trait PrivateMatchMethods: TElement {
             cascade_flags.insert(SHAREABLE)
         }
         if self.skip_root_and_item_based_display_fixup() {
             cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP)
         }
 
         // Grab the rule node.
         let rule_node = &pseudo_style.as_ref().map_or(primary_style, |p| &*p.1).rules;
-        self.cascade_with_rules(context, rule_node, primary_style, pseudo_style, cascade_flags)
+        self.cascade_with_rules(context.shared, rule_node, primary_style, pseudo_style, cascade_flags)
     }
 
     /// Computes values and damage for the primary or pseudo style of an element,
     /// setting them on the ElementData.
     fn cascade_primary_or_pseudo<'a>(&self,
                                      context: &mut StyleContext<Self>,
                                      data: &mut ElementData,
                                      pseudo: Option<&PseudoElement>,
@@ -619,17 +618,17 @@ trait PrivateMatchMethods: TElement {
             // only incomplete during the styling process.
             return style.values.as_ref().unwrap().clone();
         }
 
         let mut cascade_flags = CascadeFlags::empty();
         if self.skip_root_and_item_based_display_fixup() {
             cascade_flags.insert(SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP)
         }
-        self.cascade_with_rules(context,
+        self.cascade_with_rules(context.shared,
                                 &without_transition_rules,
                                 primary_style,
                                 &pseudo_style,
                                 cascade_flags)
     }
 
     #[cfg(feature = "gecko")]
     fn process_animations(&self,