mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue