mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make Element::get_attribute() take its namespace by reference
This commit is contained in:
parent
dd88bcddc4
commit
254207730e
12 changed files with 33 additions and 33 deletions
|
@ -250,15 +250,15 @@ impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> {
|
|||
/// Sets the owner element. Should be called after the attribute is added
|
||||
/// or removed from its older parent.
|
||||
fn set_owner(self, owner: Option<JSRef<Element>>) {
|
||||
let ns = self.namespace.clone();
|
||||
let ref ns = self.namespace;
|
||||
match (self.owner().root().r(), owner) {
|
||||
(None, Some(new)) => {
|
||||
// Already in the list of attributes of new owner.
|
||||
assert!(new.get_attribute(ns, &self.local_name).root().r() == Some(self))
|
||||
assert!(new.get_attribute(&ns, &self.local_name).root().r() == Some(self))
|
||||
}
|
||||
(Some(old), None) => {
|
||||
// Already gone from the list of attributes of old owner.
|
||||
assert!(old.get_attribute(ns, &self.local_name).is_none())
|
||||
assert!(old.get_attribute(&ns, &self.local_name).is_none())
|
||||
}
|
||||
(old, new) => assert!(old == new)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue