aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
diff options
context:
space:
mode:
authorMathieu Hordesseaux <mathieu@adopteunmec.com>2015-12-23 17:21:45 +0100
committerMathieu Hordesseaux <mathieu@adopteunmec.com>2016-01-28 12:35:44 +0100
commit322b120f8a17876cb97b6d734cfde4f68a04c5cd (patch)
tree00dc3c08ec5d9b248e70db036b66a5987f0be06a /components/script/dom/attr.rs
parentbc44ae679f0d4a01194777c56e09a48fbebea1ad (diff)
downloadservo-322b120f8a17876cb97b6d734cfde4f68a04c5cd.tar.gz
servo-322b120f8a17876cb97b6d734cfde4f68a04c5cd.zip
Implement SetNamedItem, SetNamedItemNS, SetAttributeNode and SetAttributeNodeNS
Diffstat (limited to 'components/script/dom/attr.rs')
-rw-r--r--components/script/dom/attr.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs
index 34cb8537c86..ec7b999f5b9 100644
--- a/components/script/dom/attr.rs
+++ b/components/script/dom/attr.rs
@@ -193,16 +193,12 @@ impl Attr {
pub fn set_owner(&self, owner: Option<&Element>) {
let ns = &self.identifier.namespace;
match (self.owner().r(), owner) {
- (None, Some(new)) => {
- // Already in the list of attributes of new owner.
- assert!(new.get_attribute(&ns, &self.identifier.local_name) ==
- Some(Root::from_ref(self)))
- }
(Some(old), None) => {
// Already gone from the list of attributes of old owner.
- assert!(old.get_attribute(&ns, &self.identifier.local_name).is_none())
+ assert!(old.get_attribute(&ns, &self.identifier.local_name).r() != Some(self))
}
- (old, new) => assert!(old == new),
+ (Some(old), Some(new)) => assert!(old == new),
+ _ => {},
}
self.owner.set(owner);
}