style: Remove unnecessary TraversalFlags::FOR_DEFAULT_STYLES.
draft
style: Remove unnecessary TraversalFlags::FOR_DEFAULT_STYLES.
Yay
MozReview-Commit-ID: JiWTEz63AlE
--- a/servo/components/style/traversal.rs
+++ b/servo/components/style/traversal.rs
@@ -37,18 +37,16 @@ bitflags! {
const ANIMATION_ONLY = 0x02,
/// Traverse without generating any change hints.
const FOR_RECONSTRUCT = 0x04,
/// Traverse triggered by CSS rule changes.
///
/// Traverse and update all elements with CSS animations since
/// @keyframes rules may have changed
const FOR_CSS_RULE_CHANGES = 0x08,
- /// Only include user agent style sheets when selector matching.
- const FOR_DEFAULT_STYLES = 0x10,
}
}
impl TraversalFlags {
/// Returns true if the traversal is for animation-only restyles.
pub fn for_animation_only(&self) -> bool {
self.contains(ANIMATION_ONLY)
}
@@ -62,22 +60,16 @@ impl TraversalFlags {
pub fn for_reconstruct(&self) -> bool {
self.contains(FOR_RECONSTRUCT)
}
/// Returns true if the traversal is triggered by CSS rule changes.
pub fn for_css_rule_changes(&self) -> bool {
self.contains(FOR_CSS_RULE_CHANGES)
}
-
- /// Returns true if the traversal is to compute the default computed styles
- /// for an element.
- pub fn for_default_styles(&self) -> bool {
- self.contains(FOR_DEFAULT_STYLES)
- }
}
/// This structure exists to enforce that callers invoke pre_traverse, and also
/// to pass information from the pre-traversal into the primary traversal.
pub struct PreTraverseToken {
traverse: bool,
unstyled_children_only: bool,
}
--- a/servo/ports/geckolib/glue.rs
+++ b/servo/ports/geckolib/glue.rs
@@ -108,17 +108,17 @@ use style::stylesheets::{NamespaceRule,
use style::stylesheets::StylesheetContents;
use style::stylesheets::StylesheetLoader as StyleStylesheetLoader;
use style::stylesheets::keyframes_rule::{Keyframe, KeyframeSelector, KeyframesStepValue};
use style::stylesheets::supports_rule::parse_condition_or_declaration;
use style::stylist::RuleInclusion;
use style::thread_state;
use style::timer::Timer;
use style::traversal::{ANIMATION_ONLY, DomTraversal, FOR_CSS_RULE_CHANGES, FOR_RECONSTRUCT};
-use style::traversal::{FOR_DEFAULT_STYLES, TraversalDriver, TraversalFlags, UNSTYLED_CHILDREN_ONLY};
+use style::traversal::{TraversalDriver, TraversalFlags, UNSTYLED_CHILDREN_ONLY};
use style::traversal::resolve_style;
use style::values::{CustomIdent, KeyframesName};
use style::values::computed::Context;
use style_traits::{PARSING_MODE_DEFAULT, ToCss};
use super::error_reporter::ErrorReporter;
use super::stylesheet_loader::StylesheetLoader;
/*
@@ -2792,26 +2792,21 @@ pub extern "C" fn Servo_ResolveStyleLazi
None
}
});
if let Some(result) = styles {
return result.into_strong();
}
}
- let traversal_flags = match rule_inclusion {
- RuleInclusion::All => TraversalFlags::empty(),
- RuleInclusion::DefaultOnly => FOR_DEFAULT_STYLES,
- };
-
// We don't have the style ready. Go ahead and compute it as necessary.
let shared = create_shared_context(&global_style_data,
&guard,
&data,
- traversal_flags,
+ TraversalFlags::empty(),
unsafe { &*snapshots });
let mut tlc = ThreadLocalStyleContext::new(&shared);
let mut context = StyleContext {
shared: &shared,
thread_local: &mut tlc,
};
let styles = resolve_style(&mut context, element, rule_inclusion);