ID and class selectors are ASCII case-insensitive in quirks mode.

https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
This commit is contained in:
Simon Sapin 2017-06-07 19:07:07 +02:00
parent 524fcac191
commit 5bccf98aa4
22 changed files with 313 additions and 191 deletions

View file

@ -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>;
/// 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_class(&self, name: &<Self::Impl as SelectorImpl>::ClassName) -> 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`.
///