mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Make use of the list of Atoms in ClassSelector
Make use of the list of Atoms in the class attribute selector (ClassSelector) in selector_matching. Fixes #3111
This commit is contained in:
parent
a18633b163
commit
81a0d065f1
8 changed files with 71 additions and 5 deletions
|
@ -626,11 +626,7 @@ fn matches_simple_selector<E:TElement,
|
|||
// TODO: cache and intern class names on elements.
|
||||
ClassSelector(ref class) => {
|
||||
let element = element.as_element();
|
||||
element.get_attr(&namespace::Null, "class")
|
||||
.map_or(false, |attr| {
|
||||
// TODO: case-sensitivity depends on the document type and quirks mode
|
||||
attr.split(SELECTOR_WHITESPACE).any(|c| c == class.as_slice())
|
||||
})
|
||||
element.has_class(class.as_slice())
|
||||
}
|
||||
|
||||
AttrExists(ref attr) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue