Implement From<DOMString> for Atom

This commit is contained in:
Anthony Ramine 2016-02-24 17:28:24 +01:00
parent f7fb035188
commit 0adfb08089
20 changed files with 44 additions and 38 deletions

View file

@ -55,7 +55,7 @@ impl DocumentFragmentMethods for DocumentFragment {
// https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid
fn GetElementById(&self, id: DOMString) -> Option<Root<Element>> {
let node = self.upcast::<Node>();
let id = Atom::from(&*id);
let id = Atom::from(id);
node.traverse_preorder().filter_map(Root::downcast::<Element>).find(|descendant| {
match descendant.get_attribute(&ns!(), &atom!("id")) {
None => false,