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

@ -391,7 +391,7 @@ pub trait ThreadSafeLayoutElement:
#[inline]
fn get_details_summary_pseudo(&self) -> Option<Self> {
if self.local_name() == &local_name!("details") && self.namespace() == &ns!(html) {
if self.has_local_name(&local_name!("details")) && self.has_namespace(&ns!(html)) {
Some(self.with_pseudo(PseudoElementType::DetailsSummary))
} else {
None
@ -400,8 +400,8 @@ pub trait ThreadSafeLayoutElement:
#[inline]
fn get_details_content_pseudo(&self) -> Option<Self> {
if self.local_name() == &local_name!("details") &&
self.namespace() == &ns!(html) &&
if self.has_local_name(&local_name!("details")) &&
self.has_namespace(&ns!(html)) &&
self.get_attr(&ns!(), &local_name!("open")).is_some()
{
Some(self.with_pseudo(PseudoElementType::DetailsContent))