mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Use get_attr_for_layout in get_classes_for_layout.
This fixes a bug with elements with multiple class attributes. In this case, the class attribute in the null namespace would only be considered if it was the first class attribute in the list.
This commit is contained in:
parent
21d3ddabbf
commit
0042f78aa7
2 changed files with 2 additions and 10 deletions
|
@ -221,13 +221,8 @@ impl RawLayoutElementHelpers for Element {
|
|||
|
||||
#[inline]
|
||||
unsafe fn get_classes_for_layout(&self) -> Option<&'static [Atom]> {
|
||||
let attrs = self.attrs.borrow_for_layout();
|
||||
(*attrs).iter().find(|attr: & &JS<Attr>| {
|
||||
let attr = attr.to_layout().unsafe_get();
|
||||
(*attr).local_name_atom_forever() == atom!("class")
|
||||
}).and_then(|attr| {
|
||||
let attr = attr.to_layout().unsafe_get();
|
||||
(*attr).value_tokens_forever()
|
||||
get_attr_for_layout(self, &ns!(""), &atom!("class")).map(|attr| {
|
||||
(*attr.unsafe_get()).value_tokens_forever().unwrap()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue