style: Do not use borrowed types in the selectors::Element trait.

Closes #22972
Closes #23463
This commit is contained in:
Evgeniy Reizner 2019-05-26 19:10:24 +03:00 committed by Emilio Cobos Álvarez
parent 2e5078e9c5
commit 6f1df517e0
8 changed files with 100 additions and 42 deletions

View file

@ -3004,12 +3004,17 @@ impl<'a> SelectorsElement for DomRoot<Element> {
})
}
fn local_name(&self) -> &LocalName {
Element::local_name(self)
fn has_local_name(&self, local_name: &LocalName) -> bool {
Element::local_name(self) == local_name
}
fn namespace(&self) -> &Namespace {
Element::namespace(self)
fn has_namespace(&self, ns: &Namespace) -> bool {
Element::namespace(self) == ns
}
fn is_same_type(&self, other: &Self) -> bool {
Element::local_name(self) == Element::local_name(other) &&
Element::namespace(self) == Element::namespace(other)
}
fn match_non_ts_pseudo_class<F>(