Use get_attr_for_layout in get_attr_atom_for_layout.

The code is equivalent.
This commit is contained in:
Ms2ger 2015-04-18 16:53:05 +02:00
parent d67d6bfa3a
commit 39e3ace817

View file

@ -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()
})
}