mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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]
|
||||
unsafe fn get_attr_atom_for_layout(&self, namespace: &Namespace, name: &Atom)
|
||||
-> Option<Atom> {
|
||||
let attrs = self.attrs.borrow_for_layout();
|
||||
(*attrs).iter().find(|attr: & &JS<Attr>| {
|
||||
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()
|
||||
get_attr_for_layout(self, namespace, name).and_then(|attr| {
|
||||
(*attr.unsafe_get()).value_atom_forever()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue