style: Note :lang() as being sensitive to attributes.
draft
style: Note :lang() as being sensitive to attributes.
MozReview-Commit-ID: 8bxlLCPc8tS
--- a/servo/components/style/gecko/selector_parser.rs
+++ b/servo/components/style/gecko/selector_parser.rs
@@ -210,17 +210,18 @@ impl NonTSPseudoClass {
apply_non_ts_list!(pseudo_class_geckotype)
}
/// Returns true if the evaluation of the pseudo-class depends on the
/// element's attributes.
pub fn is_attr_based(&self) -> bool {
matches!(*self,
NonTSPseudoClass::MozTableBorderNonzero |
- NonTSPseudoClass::MozBrowserFrame)
+ NonTSPseudoClass::MozBrowserFrame |
+ NonTSPseudoClass::Lang(..))
}
}
/// The dummy struct we use to implement our selector parsing.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SelectorImpl;
impl ::selectors::SelectorImpl for SelectorImpl {
--- a/servo/components/style/servo/selector_parser.rs
+++ b/servo/components/style/servo/selector_parser.rs
@@ -271,17 +271,17 @@ impl NonTSPseudoClass {
/// Returns true if the given pseudoclass should trigger style sharing cache revalidation.
pub fn needs_cache_revalidation(&self) -> bool {
self.state_flag().is_empty()
}
/// Returns true if the evaluation of the pseudo-class depends on the
/// element's attributes.
pub fn is_attr_based(&self) -> bool {
- false
+ matches!(*this, NonTSPseudoClass::Lang(..))
}
}
/// The abstract struct we implement the selector parser implementation on top
/// of.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct SelectorImpl;