Bug 1364412: Track pseudo-element's state dependencies too. r?heycam
MozReview-Commit-ID: 8zOE7TyW1xi
--- a/servo/components/style/stylist.rs
+++ b/servo/components/style/stylist.rs
@@ -490,16 +490,19 @@ impl Stylist {
/// Returns whether the given ElementState bit is relied upon by a selector
/// of some rule in the stylist.
pub fn has_state_dependency(&self, state: ElementState) -> bool {
self.state_dependencies.intersects(state)
}
#[inline]
fn note_attribute_and_state_dependencies(&mut self, selector: &Selector<SelectorImpl>) {
+ if let Some(ref pseudo_selector) = selector.pseudo_element {
+ self.state_dependencies.insert(pseudo_selector.state());
+ }
selector.visit(&mut AttributeAndStateDependencyVisitor(self));
}
/// Computes the style for a given "precomputed" pseudo-element, taking the
/// universal rules and applying them.
///
/// If `inherit_all` is true, then all properties are inherited from the
/// parent; otherwise, non-inherited properties are reset to their initial