diff options
Diffstat (limited to 'components/selectors/tree.rs')
-rw-r--r-- | components/selectors/tree.rs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/components/selectors/tree.rs b/components/selectors/tree.rs index 7a47f2b4ab1..97114de031d 100644 --- a/components/selectors/tree.rs +++ b/components/selectors/tree.rs @@ -5,7 +5,7 @@ //! Traits that nodes must implement. Breaks the otherwise-cyclic dependency //! between layout and style. -use attr::{AttrSelectorOperation, NamespaceConstraint}; +use attr::{AttrSelectorOperation, NamespaceConstraint, CaseSensitivity}; use matching::{ElementSelectorFlags, LocalMatchingContext, MatchingContext, RelevantLinkStatus}; use parser::SelectorImpl; use std::fmt::Debug; @@ -63,9 +63,20 @@ pub trait Element: Sized + Debug { /// Whether this element is a `link`. fn is_link(&self) -> bool; - fn get_id(&self) -> Option<<Self::Impl as SelectorImpl>::Identifier>; - - fn has_class(&self, name: &<Self::Impl as SelectorImpl>::ClassName) -> bool; + /// Whether this element is in a document that is in quirks mode. + /// + /// https://dom.spec.whatwg.org/#concept-document-quirks + fn in_quirks_mode_document(&self) -> bool; + + fn has_id(&self, + id: &<Self::Impl as SelectorImpl>::Identifier, + case_sensitivity: CaseSensitivity) + -> bool; + + fn has_class(&self, + name: &<Self::Impl as SelectorImpl>::ClassName, + case_sensitivity: CaseSensitivity) + -> bool; /// Returns whether this element matches `:empty`. /// |