mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement From<DOMString> for Atom
This commit is contained in:
parent
f7fb035188
commit
0adfb08089
20 changed files with 44 additions and 38 deletions
|
@ -617,7 +617,7 @@ impl Element {
|
|||
if self.html_element_in_html_document() {
|
||||
name.make_ascii_lowercase();
|
||||
}
|
||||
Atom::from(&*name)
|
||||
Atom::from(name)
|
||||
}
|
||||
|
||||
pub fn namespace(&self) -> &Namespace {
|
||||
|
@ -952,7 +952,7 @@ impl Element {
|
|||
}
|
||||
|
||||
// Steps 2-5.
|
||||
let name = Atom::from(&*name);
|
||||
let name = Atom::from(name);
|
||||
let value = self.parse_attribute(&ns!(), &name, value);
|
||||
self.set_first_matching_attribute(name.clone(),
|
||||
value,
|
||||
|
@ -1249,7 +1249,7 @@ impl ElementMethods for Element {
|
|||
local_name: DOMString)
|
||||
-> Option<Root<Attr>> {
|
||||
let namespace = &namespace_from_domstring(namespace);
|
||||
self.get_attribute(namespace, &Atom::from(&*local_name))
|
||||
self.get_attribute(namespace, &Atom::from(local_name))
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-setattribute
|
||||
|
@ -1277,7 +1277,7 @@ impl ElementMethods for Element {
|
|||
value: DOMString) -> ErrorResult {
|
||||
let (namespace, prefix, local_name) =
|
||||
try!(validate_and_extract(namespace, &qualified_name));
|
||||
let qualified_name = Atom::from(&*qualified_name);
|
||||
let qualified_name = Atom::from(qualified_name);
|
||||
let value = self.parse_attribute(&namespace, &local_name, value);
|
||||
self.set_first_matching_attribute(
|
||||
local_name.clone(), value, qualified_name, namespace.clone(), prefix,
|
||||
|
@ -1344,7 +1344,7 @@ impl ElementMethods for Element {
|
|||
// https://dom.spec.whatwg.org/#dom-element-removeattributens
|
||||
fn RemoveAttributeNS(&self, namespace: Option<DOMString>, local_name: DOMString) {
|
||||
let namespace = namespace_from_domstring(namespace);
|
||||
let local_name = Atom::from(&*local_name);
|
||||
let local_name = Atom::from(local_name);
|
||||
self.remove_attribute(&namespace, &local_name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue