mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Replace many uses of Attr::Value() by Attr::value()
The later only borrows the attribute, without copying its value as a string.
This commit is contained in:
parent
105d990845
commit
51418fc348
5 changed files with 30 additions and 28 deletions
|
@ -1581,11 +1581,11 @@ impl VirtualMethods for Element {
|
|||
if !tree_in_doc { return; }
|
||||
|
||||
if let Some(ref attr) = self.get_attribute(&ns!(""), &atom!("id")) {
|
||||
let doc = document_from_node(self);
|
||||
let value = attr.r().Value();
|
||||
let value = attr.value();
|
||||
if !value.is_empty() {
|
||||
let doc = document_from_node(self);
|
||||
let value = Atom::from_slice(&value);
|
||||
doc.r().register_named_element(self, value);
|
||||
doc.register_named_element(self, value.to_owned());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1598,11 +1598,11 @@ impl VirtualMethods for Element {
|
|||
if !tree_in_doc { return; }
|
||||
|
||||
if let Some(ref attr) = self.get_attribute(&ns!(""), &atom!("id")) {
|
||||
let doc = document_from_node(self);
|
||||
let value = attr.r().Value();
|
||||
let value = attr.value();
|
||||
if !value.is_empty() {
|
||||
let doc = document_from_node(self);
|
||||
let value = Atom::from_slice(&value);
|
||||
doc.r().unregister_named_element(self, value);
|
||||
doc.unregister_named_element(self, value.to_owned());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue