diff options
author | Cameron McCormack <cam@mcc.id.au> | 2017-10-18 14:17:32 +0800 |
---|---|---|
committer | Cameron McCormack <cam@mcc.id.au> | 2017-10-20 13:13:13 +0800 |
commit | d58c967efac3cab538fb59029e6e693d9fcc3fca (patch) | |
tree | 5fd50563c656e8620a339a3bbd042c109dc5f364 /components/style/gecko | |
parent | c22dba0b87d7ba97cd094b811715fa79dad9b8b4 (diff) | |
download | servo-d58c967efac3cab538fb59029e6e693d9fcc3fca.tar.gz servo-d58c967efac3cab538fb59029e6e693d9fcc3fca.zip |
style: Record DocumentState dependencies.
Diffstat (limited to 'components/style/gecko')
-rw-r--r-- | components/style/gecko/selector_parser.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/components/style/gecko/selector_parser.rs b/components/style/gecko/selector_parser.rs index cb2c9d80050..0fe124beafa 100644 --- a/components/style/gecko/selector_parser.rs +++ b/components/style/gecko/selector_parser.rs @@ -5,7 +5,7 @@ //! Gecko-specific bits for selector-parsing. use cssparser::{BasicParseError, BasicParseErrorKind, Parser, ToCss, Token, CowRcStr, SourceLocation}; -use element_state::ElementState; +use element_state::{self, DocumentState, ElementState}; use gecko_bindings::structs::CSSPseudoClassType; use gecko_bindings::structs::RawServoSelectorList; use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI}; @@ -195,6 +195,15 @@ impl NonTSPseudoClass { apply_non_ts_list!(pseudo_class_state) } + /// Get the document state flag associated with a pseudo-class, if any. + pub fn document_state_flag(&self) -> DocumentState { + match *self { + NonTSPseudoClass::MozLocaleDir(..) => element_state::NS_DOCUMENT_STATE_RTL_LOCALE, + NonTSPseudoClass::MozWindowInactive => element_state::NS_DOCUMENT_STATE_WINDOW_INACTIVE, + _ => DocumentState::empty(), + } + } + /// Returns true if the given pseudoclass should trigger style sharing cache /// revalidation. pub fn needs_cache_revalidation(&self) -> bool { |