Use Temporary in ChildElementIterator

This commit is contained in:
Anthony Ramine 2015-04-06 03:40:57 +02:00
parent bf7c791e3a
commit 11b4ff9e94
2 changed files with 11 additions and 14 deletions

View file

@ -927,7 +927,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
// http://dom.spec.whatwg.org/#dom-document-documentelement
fn GetDocumentElement(self) -> Option<Temporary<Element>> {
let node: JSRef<Node> = NodeCast::from_ref(self);
node.child_elements().next().map(Temporary::from_rooted)
node.child_elements().next()
}
// http://dom.spec.whatwg.org/#dom-document-getelementsbytagname