mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Introduce AttrHelpersForLayout::namespace
This commit is contained in:
parent
47c9f19121
commit
3e875ce3eb
2 changed files with 7 additions and 1 deletions
|
@ -238,6 +238,7 @@ pub trait AttrHelpersForLayout<'dom> {
|
|||
fn as_str(self) -> &'dom str;
|
||||
fn as_tokens(self) -> Option<&'dom [Atom]>;
|
||||
fn local_name(self) -> &'dom LocalName;
|
||||
fn namespace(self) -> &'dom Namespace;
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -265,4 +266,9 @@ impl<'dom> AttrHelpersForLayout<'dom> for LayoutDom<'dom, Attr> {
|
|||
fn local_name(self) -> &'dom LocalName {
|
||||
unsafe { &self.unsafe_get().identifier.local_name }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn namespace(self) -> &'dom Namespace {
|
||||
unsafe { &self.unsafe_get().identifier.namespace }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -578,7 +578,7 @@ pub unsafe fn get_attr_for_layout<'dom>(
|
|||
.iter()
|
||||
.find(|attr| {
|
||||
let attr = attr.to_layout();
|
||||
name == attr.local_name() && (*attr.unsafe_get()).namespace() == namespace
|
||||
name == attr.local_name() && namespace == attr.namespace()
|
||||
})
|
||||
.map(|attr| attr.to_layout())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue