Bug 1311257 - Make cascade_with_rules take SharedStyleContext instead StyleContext. r?heycam
MozReview-Commit-ID: CsLfQcmBhLM
--- 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,