style: Record DocumentState dependencies.

This commit is contained in:
Cameron McCormack 2017-10-18 14:17:32 +08:00
parent c22dba0b87
commit d58c967efa
4 changed files with 39 additions and 3 deletions

View file

@ -10,7 +10,7 @@ use {Atom, Prefix, Namespace, LocalName, CaseSensitivityExt};
use attr::{AttrIdentifier, AttrValue};
use cssparser::{Parser as CssParser, ToCss, serialize_identifier, CowRcStr, SourceLocation};
use dom::{OpaqueNode, TElement, TNode};
use element_state::ElementState;
use element_state::{DocumentState, ElementState};
use fnv::FnvHashMap;
use invalidation::element::element_wrapper::ElementSnapshot;
use properties::ComputedValues;
@ -353,6 +353,11 @@ impl NonTSPseudoClass {
}
}
/// Get the document state flag associated with a pseudo-class, if any.
pub fn document_state_flag(&self) -> DocumentState {
DocumentState::empty()
}
/// Returns true if the given pseudoclass should trigger style sharing cache revalidation.
pub fn needs_cache_revalidation(&self) -> bool {
self.state_flag().is_empty()