mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Record DocumentState dependencies.
This commit is contained in:
parent
c22dba0b87
commit
d58c967efa
4 changed files with 39 additions and 3 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue