aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/attr.rs
diff options
context:
space:
mode:
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);
}