diff --git a/components/style/invalidation/element/invalidation_map.rs b/components/style/invalidation/element/invalidation_map.rs index 8e4dfebec99..7ea92c25d85 100644 --- a/components/style/invalidation/element/invalidation_map.rs +++ b/components/style/invalidation/element/invalidation_map.rs @@ -109,10 +109,6 @@ impl SelectorMapEntry for Dependency { fn selector(&self) -> SelectorIter { self.selector.iter_from(self.selector_offset) } - - fn hashes(&self) -> &AncestorHashes { - &self.hashes - } } /// The same, but for state selectors, which can track more exactly what state @@ -128,11 +124,7 @@ pub struct StateDependency { impl SelectorMapEntry for StateDependency { fn selector(&self) -> SelectorIter { - self.dep.selector.iter_from(self.dep.selector_offset) - } - - fn hashes(&self) -> &AncestorHashes { - &self.dep.hashes + self.dep.selector() } } diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index 77052990edc..6ef72d15716 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -14,7 +14,7 @@ use pdqsort::sort_by; use rule_tree::CascadeLevel; use selector_parser::SelectorImpl; use selectors::matching::{matches_selector, MatchingContext, ElementSelectorFlags}; -use selectors::parser::{AncestorHashes, Component, Combinator, SelectorAndHashes, SelectorIter}; +use selectors::parser::{Component, Combinator, SelectorAndHashes, SelectorIter}; use selectors::parser::LocalName as LocalNameSelector; use smallvec::VecLike; use std::collections::HashMap; @@ -26,19 +26,12 @@ use stylist::Rule; pub trait SelectorMapEntry : Sized + Clone { /// Gets the selector we should use to index in the selector map. fn selector(&self) -> SelectorIter; - - /// Gets the ancestor hashes associated with the selector. - fn hashes(&self) -> &AncestorHashes; } impl SelectorMapEntry for SelectorAndHashes { fn selector(&self) -> SelectorIter { self.selector.iter() } - - fn hashes(&self) -> &AncestorHashes { - &self.hashes - } } /// Map element data to selector-providing objects for which the last simple @@ -65,7 +58,7 @@ impl SelectorMapEntry for SelectorAndHashes { /// TODO: Tune the initial capacity of the HashMap #[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -pub struct SelectorMap { +pub struct SelectorMap { /// A hash from an ID to rules which contain that ID selector. pub id_hash: MaybeCaseInsensitiveHashMap>, /// A hash from a class name to rules which contain that class selector. @@ -83,7 +76,7 @@ fn sort_by_key K, K: Ord>(v: &mut [T], f: F) { sort_by(v, |a, b| f(a).cmp(&f(b))) } -impl SelectorMap { +impl SelectorMap { /// Trivially constructs an empty `SelectorMap`. pub fn new() -> Self { SelectorMap { diff --git a/components/style/stylist.rs b/components/style/stylist.rs index 6c429a427bf..b3ff2cc9e37 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -1461,10 +1461,6 @@ impl SelectorMapEntry for RevalidationSelectorAndHashes { fn selector(&self) -> SelectorIter { self.selector.iter_from(self.selector_offset) } - - fn hashes(&self) -> &AncestorHashes { - &self.hashes - } } /// Visitor to determine whether a selector requires cache revalidation. @@ -1609,10 +1605,6 @@ impl SelectorMapEntry for Rule { fn selector(&self) -> SelectorIter { self.selector.iter() } - - fn hashes(&self) -> &AncestorHashes { - &self.hashes - } } impl Rule {