Miscellaneous build / tidy fixes.

This commit is contained in:
Emilio Cobos Álvarez 2021-02-26 12:40:48 +01:00
parent 5158f65810
commit 31e8e418ea
66 changed files with 566 additions and 294 deletions

View file

@ -16,7 +16,6 @@ use selectors::matching::{self, MatchingContext, MatchingMode};
use selectors::parser::{Combinator, Component, LocalName, SelectorImpl};
use selectors::{Element, NthIndexCache, SelectorList};
use smallvec::SmallVec;
use std::borrow::Borrow;
/// <https://dom.spec.whatwg.org/#dom-element-matches>
pub fn element_matches<E>(
@ -354,11 +353,14 @@ where
ref name,
ref lower_name,
} = *local_name;
if element.is_html_element_in_html_document() {
element.local_name() == lower_name.borrow()
let chosen_name = if element.is_html_element_in_html_document() {
lower_name
} else {
element.local_name() == name.borrow()
}
name
};
element.local_name() == &**chosen_name
}
/// Fast paths for querySelector with a single simple selector.