mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -340,7 +340,7 @@ impl HTMLElement {
|
|||
|
||||
pub fn get_custom_attr(&self, local_name: DOMString) -> Option<DOMString> {
|
||||
// FIXME(ajeffrey): Convert directly from DOMString to Atom
|
||||
let local_name = Atom::from(&*to_snake_case(local_name));
|
||||
let local_name = Atom::from(to_snake_case(local_name));
|
||||
self.upcast::<Element>().get_attribute(&ns!(), &local_name).map(|attr| {
|
||||
DOMString::from(&**attr.value()) // FIXME(ajeffrey): Convert directly from AttrValue to DOMString
|
||||
})
|
||||
|
@ -348,7 +348,7 @@ impl HTMLElement {
|
|||
|
||||
pub fn delete_custom_attr(&self, local_name: DOMString) {
|
||||
// FIXME(ajeffrey): Convert directly from DOMString to Atom
|
||||
let local_name = Atom::from(&*to_snake_case(local_name));
|
||||
let local_name = Atom::from(to_snake_case(local_name));
|
||||
self.upcast::<Element>().remove_attribute(&ns!(), &local_name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue