mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement removeAttributeNode
This commit implement removeAttributeNode, as described here: https://dom.spec.whatwg.org/#dom-element-removeattributenode See also #8724 and #8068.
This commit is contained in:
parent
918681931f
commit
d28c9a1588
5 changed files with 8 additions and 18 deletions
|
@ -1358,6 +1358,12 @@ impl ElementMethods for Element {
|
|||
self.remove_attribute(&namespace, &local_name);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-removeattributenode
|
||||
fn RemoveAttributeNode(&self, attr: &Attr) -> Fallible<Root<Attr>> {
|
||||
self.remove_first_matching_attribute(|a| a == attr)
|
||||
.ok_or(Error::NotFound)
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-hasattribute
|
||||
fn HasAttribute(&self, name: DOMString) -> bool {
|
||||
self.GetAttribute(name).is_some()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue