diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-04-11 14:12:44 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-04-13 11:01:02 +0200 |
commit | e20d997b37d93d35d2a80761d8e125351d9165bc (patch) | |
tree | a8d976b5919028dc894fda2807b2987548eeba06 /components/script/script_task.rs | |
parent | c026825e69cab4f481773716fac4956610594ecb (diff) | |
download | servo-e20d997b37d93d35d2a80761d8e125351d9165bc.tar.gz servo-e20d997b37d93d35d2a80761d8e125351d9165bc.zip |
Use a simple Temporary value in TreeIterator
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 93d176e3b18..40eae7e0f74 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -24,7 +24,7 @@ use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, Documen use dom::bindings::codegen::InheritTypes::{ElementCast, EventTargetCast, HTMLIFrameElementCast, NodeCast, EventCast}; use dom::bindings::conversions::FromJSValConvertible; use dom::bindings::conversions::StringificationBehavior; -use dom::bindings::js::{JS, JSRef, Temporary, OptionalRootable, RootedReference}; +use dom::bindings::js::{JS, JSRef, OptionalRootable, RootedReference}; use dom::bindings::js::{RootCollection, RootCollectionPtr}; use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference}; use dom::bindings::structuredclone::StructuredCloneData; @@ -811,9 +811,8 @@ impl ScriptTask { let doc: JSRef<Node> = NodeCast::from_ref(doc.r()); doc.traverse_preorder() - .filter_map(HTMLIFrameElementCast::to_ref) - .find(|node| node.subpage_id() == Some(subpage_id)) - .map(Temporary::from_rooted) + .filter_map(HTMLIFrameElementCast::to_temporary) + .find(|node| node.root().r().subpage_id() == Some(subpage_id)) }).root(); if let Some(frame_element) = frame_element { @@ -832,9 +831,8 @@ impl ScriptTask { let doc: JSRef<Node> = NodeCast::from_ref(doc.r()); doc.traverse_preorder() - .filter_map(HTMLIFrameElementCast::to_ref) - .find(|node| node.subpage_id() == Some(old_subpage_id)) - .map(Temporary::from_rooted) + .filter_map(HTMLIFrameElementCast::to_temporary) + .find(|node| node.root().r().subpage_id() == Some(old_subpage_id)) }).root(); frame_element.unwrap().r().update_subpage_id(new_subpage_id); @@ -952,10 +950,9 @@ impl ScriptTask { let doc: JSRef<Node> = NodeCast::from_ref(doc.r()); doc.traverse_preorder() - .filter_map(HTMLIFrameElementCast::to_ref) - .find(|node| node.subpage_id() == Some(subpage_id)) - .map(ElementCast::from_ref) - .map(Temporary::from_rooted) + .filter_map(HTMLIFrameElementCast::to_temporary) + .find(|node| node.root().r().subpage_id() == Some(subpage_id)) + .map(ElementCast::from_temporary) }) }) }).root(); @@ -1218,9 +1215,8 @@ impl ScriptTask { let doc: JSRef<Node> = NodeCast::from_ref(doc.r()); doc.traverse_preorder() - .filter_map(HTMLIFrameElementCast::to_ref) - .find(|node| node.subpage_id() == Some(subpage_id)) - .map(Temporary::from_rooted) + .filter_map(HTMLIFrameElementCast::to_temporary) + .find(|node| node.root().r().subpage_id() == Some(subpage_id)) }).root(); if let Some(iframe) = iframe.r() { iframe.navigate_child_browsing_context(load_data.url); |