Remove unused AFFECTED_BY_PSEUDO_ELEMENTS StyleRelation.
draft
Remove unused AFFECTED_BY_PSEUDO_ELEMENTS StyleRelation.
MozReview-Commit-ID: yHldvHm87b
--- a/servo/components/selectors/context.rs
+++ b/servo/components/selectors/context.rs
@@ -10,18 +10,16 @@ bitflags! {
/// 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,
- /// Whether this element has pseudo-element styles. Computed externally.
- const AFFECTED_BY_PSEUDO_ELEMENTS = 1 << 1,
}
}
/// What kind of selector matching mode we should use.
///
/// There are two modes of selector matching. The difference is only noticeable
/// in presence of pseudo-elements.
#[derive(Debug, PartialEq, Copy, Clone)]
--- a/servo/components/style/matching.rs
+++ b/servo/components/style/matching.rs
@@ -19,17 +19,17 @@ use invalidation::element::restyle_hints
use log::LogLevel::Trace;
use properties::{AnimationRules, CascadeFlags, ComputedValues};
use properties::{IS_ROOT_ELEMENT, PROHIBIT_DISPLAY_CONTENTS, SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP};
use properties::{VISITED_DEPENDENT_ONLY, cascade};
use properties::longhands::display::computed_value as display;
use rule_tree::{CascadeLevel, StrongRuleNode};
use selector_parser::{PseudoElement, RestyleDamage, SelectorImpl};
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, StyleRelations};
-use selectors::matching::{VisitedHandlingMode, AFFECTED_BY_PSEUDO_ELEMENTS};
+use selectors::matching::VisitedHandlingMode;
use sharing::StyleSharingBehavior;
use stylearc::Arc;
use stylist::RuleInclusion;
/// Whether we are cascading for an eager pseudo-element or something else.
///
/// Controls where we inherit styles from, and whether display:contents is
/// prohibited.
@@ -998,17 +998,17 @@ pub trait MatchMethods : TElement {
context: &mut StyleContext<Self>,
data: &mut ElementData,
sharing: StyleSharingBehavior)
-> ChildCascadeRequirement
{
debug!("Match and cascade for {:?}", self);
// Perform selector matching for the primary style.
- let mut primary_results =
+ let primary_results =
self.match_primary(context, data, VisitedHandlingMode::AllLinksUnvisited);
let important_rules_changed =
primary_results.important_rules_overriding_animation_changed;
// If there's a relevant link involved, match and cascade primary styles
// as if the link is visited as well. This is done before the regular
// cascade because the visited ComputedValues are placed within the
// regular ComputedValues, which is immutable after the cascade.
@@ -1046,21 +1046,16 @@ pub trait MatchMethods : TElement {
if relevant_link_found {
self.match_pseudos(context, data, VisitedHandlingMode::RelevantLinkVisited);
self.cascade_pseudos(context, data, CascadeVisitedMode::Visited);
}
self.cascade_pseudos(context, data, CascadeVisitedMode::Unvisited);
}
- // If we have any pseudo elements, indicate so in the primary StyleRelations.
- if !data.styles.pseudos.is_empty() {
- primary_results.relations |= AFFECTED_BY_PSEUDO_ELEMENTS;
- }
-
// If the style is shareable, add it to the LRU cache.
if sharing == StyleSharingBehavior::Allow {
// If we previously tried to match this element against the cache,
// the revalidation match results will already be cached. Otherwise
// we'll have None, and compute them later on-demand.
//
// If we do have the results, grab them here to satisfy the borrow
// checker.