mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
Use get_attr_for_layout in get_attr_atom_for_layout.
The code is equivalent.
This commit is contained in:
parent
d67d6bfa3a
commit
39e3ace817
1 changed files with 2 additions and 8 deletions
|
@ -207,14 +207,8 @@ impl RawLayoutElementHelpers for Element {
|
||||||
#[inline]
|
#[inline]
|
||||||
unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom)
|
unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom)
|
||||||
-> Option<Atom> {
|
-> Option<Atom> {
|
||||||
let attrs = self.attrs.borrow_for_layout();
|
get_attr_for_layout(self, namespace, name).and_then(|attr| {
|
||||||
(*attrs).iter().find(|attr: & &JS<Attr>| {
|
(*attr.unsafe_get()).value_atom_forever()
|
||||||
let attr = attr.to_layout().unsafe_get();
|
|
||||||
*name == (*attr).local_name_atom_forever() &&
|
|
||||||
(*attr).namespace() == namespace
|
|
||||||
}).and_then(|attr| {
|
|
||||||
let attr = attr.to_layout().unsafe_get();
|
|
||||||
(*attr).value_atom_forever()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue