diff --git a/components/selectors/context.rs b/components/selectors/context.rs index e27cd6811bb..6cf516b74fc 100644 --- a/components/selectors/context.rs +++ b/components/selectors/context.rs @@ -5,19 +5,6 @@ use attr::CaseSensitivity; use bloom::BloomFilter; -bitflags! { - /// Set of flags that determine the different kind of elements affected by - /// the selector matching process. - /// - /// This is used to implement efficient sharing. - #[derive(Default)] - pub flags StyleRelations: usize { - /// Whether this element is affected by presentational hints. This is - /// computed externally (that is, in Servo). - const AFFECTED_BY_PRESENTATIONAL_HINTS = 1 << 0, - } -} - /// What kind of selector matching mode we should use. /// /// There are two modes of selector matching. The difference is only noticeable @@ -87,9 +74,6 @@ impl QuirksMode { /// transient data that applies to only a single selector. #[derive(Clone)] pub struct MatchingContext<'a> { - /// Output that records certains relations between elements noticed during - /// matching (and also extended after matching). - pub relations: StyleRelations, /// Input with the matching mode we should use when matching selectors. pub matching_mode: MatchingMode, /// Input with the bloom filter used to fast-reject selectors. @@ -114,7 +98,6 @@ impl<'a> MatchingContext<'a> { -> Self { Self { - relations: StyleRelations::empty(), matching_mode: matching_mode, bloom_filter: bloom_filter, visited_handling: VisitedHandlingMode::AllLinksUnvisited, @@ -132,7 +115,6 @@ impl<'a> MatchingContext<'a> { -> Self { Self { - relations: StyleRelations::empty(), matching_mode: matching_mode, bloom_filter: bloom_filter, visited_handling: visited_handling, diff --git a/components/selectors/matching.rs b/components/selectors/matching.rs index 3d6e86671e3..9fc5b0815a1 100644 --- a/components/selectors/matching.rs +++ b/components/selectors/matching.rs @@ -714,8 +714,6 @@ fn matches_simple_selector( matches_last_child(element, flags_setter) } Component::Root => { - // We never share styles with an element with no parent, so no point - // in creating a new StyleRelation. element.is_root() } Component::Empty => { diff --git a/components/style/stylist.rs b/components/style/stylist.rs index dadcec02a1e..6c429a427bf 100644 --- a/components/style/stylist.rs +++ b/components/style/stylist.rs @@ -26,7 +26,7 @@ use selector_parser::{SelectorImpl, PseudoElement}; use selectors::attr::NamespaceConstraint; use selectors::bloom::BloomFilter; use selectors::matching::{ElementSelectorFlags, matches_selector, MatchingContext, MatchingMode}; -use selectors::matching::{VisitedHandlingMode, AFFECTED_BY_PRESENTATIONAL_HINTS}; +use selectors::matching::VisitedHandlingMode; use selectors::parser::{AncestorHashes, Combinator, Component, Selector, SelectorAndHashes}; use selectors::parser::{SelectorIter, SelectorMethods}; use selectors::sink::Push; @@ -1145,7 +1145,6 @@ impl Stylist { self.quirks_mode, flags_setter, CascadeLevel::UANormal); - debug!("UA normal: {:?}", context.relations); if pseudo_element.is_none() && !only_default_rules { // Step 2: Presentational hints. @@ -1160,12 +1159,7 @@ impl Stylist { assert_eq!(declaration.level(), CascadeLevel::PresHints); } } - // Note the existence of presentational attributes so that the - // style sharing cache can avoid re-querying them if they don't - // exist. - context.relations |= AFFECTED_BY_PRESENTATIONAL_HINTS; } - debug!("preshints: {:?}", context.relations); } // NB: the following condition, although it may look somewhat @@ -1185,7 +1179,6 @@ impl Stylist { self.quirks_mode, flags_setter, CascadeLevel::UserNormal); - debug!("user normal: {:?}", context.relations); } else { debug!("skipping user rules"); } @@ -1194,7 +1187,6 @@ impl Stylist { let cut_off_inheritance = element.get_declarations_from_xbl_bindings(pseudo_element, applicable_declarations); - debug!("XBL: {:?}", context.relations); if rule_hash_target.matches_user_and_author_rules() && !only_default_rules { // Gecko skips author normal rules if cutting off inheritance. @@ -1208,7 +1200,6 @@ impl Stylist { self.quirks_mode, flags_setter, CascadeLevel::AuthorNormal); - debug!("author normal: {:?}", context.relations); } else { debug!("skipping author normal rules due to cut off inheritance"); } @@ -1224,7 +1215,6 @@ impl Stylist { ApplicableDeclarationBlock::from_declarations(sa.clone(), CascadeLevel::StyleAttributeNormal)); } - debug!("style attr: {:?}", context.relations); // Step 5: SMIL override. // Declarations from SVG SMIL animation elements. @@ -1234,7 +1224,6 @@ impl Stylist { ApplicableDeclarationBlock::from_declarations(so.clone(), CascadeLevel::SMILOverride)); } - debug!("SMIL: {:?}", context.relations); // Step 6: Animations. // The animations sheet (CSS animations, script-generated animations, @@ -1245,7 +1234,6 @@ impl Stylist { ApplicableDeclarationBlock::from_declarations(anim.clone(), CascadeLevel::Animations)); } - debug!("animation: {:?}", context.relations); } else { debug!("skipping style attr and SMIL & animation rules"); } @@ -1264,12 +1252,9 @@ impl Stylist { ApplicableDeclarationBlock::from_declarations(anim.clone(), CascadeLevel::Transitions)); } - debug!("transition: {:?}", context.relations); } else { debug!("skipping transition rules"); } - - debug!("push_applicable_declarations: shareable: {:?}", context.relations); } /// Given an id, returns whether there might be any rules for that id in any