mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Support [*|attr], attribute selectors in any namespace (fixes #1558)
This commit is contained in:
parent
070b6046aa
commit
b9e23563bb
7 changed files with 57 additions and 10 deletions
|
@ -310,8 +310,10 @@ impl<'ln> TNode<'ln, LayoutElement<'ln>> for LayoutNode<'ln> {
|
|||
element.get_attr(ns, name)
|
||||
.map_or(false, |attr| test(attr))
|
||||
},
|
||||
// FIXME: https://github.com/mozilla/servo/issues/1558
|
||||
AnyNamespace => false,
|
||||
AnyNamespace => {
|
||||
let element = self.as_element();
|
||||
element.get_attrs(name).iter().any(|attr| test(*attr))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -414,6 +416,11 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
|
|||
unsafe { self.element.get_attr_val_for_layout(namespace, name) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn get_attrs(self, name: &str) -> Vec<&'le str> {
|
||||
unsafe { self.element.get_attr_vals_for_layout(name) }
|
||||
}
|
||||
|
||||
fn get_link(self) -> Option<&'le str> {
|
||||
// FIXME: This is HTML only.
|
||||
match self.element.node.type_id_for_layout() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue