diff options
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index a9afc1ad468..e11db71355d 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -24,8 +24,9 @@ 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::{RootCollection, RootCollectionPtr}; +use dom::bindings::js::{JS, JSRef, OptionalRootable, RootCollection}; +use dom::bindings::js::{RootCollectionPtr, Rootable, RootedReference}; +use dom::bindings::js::Temporary; use dom::bindings::refcounted::{LiveDOMReferences, Trusted, TrustedReference}; use dom::bindings::structuredclone::StructuredCloneData; use dom::bindings::trace::{JSTraceable, trace_collections, RootedVec}; @@ -151,7 +152,7 @@ impl InProgressLoad { } } -#[derive(Copy)] +#[derive(Copy, Clone)] pub enum TimerSource { FromWindow(PipelineId), FromWorker @@ -717,9 +718,9 @@ impl ScriptTask { self.handle_freeze_msg(pipeline_id), ConstellationControlMsg::Thaw(pipeline_id) => self.handle_thaw_msg(pipeline_id), - ConstellationControlMsg::MozBrowserEventMsg(parent_pipeline_id, - subpage_id, - event) => + ConstellationControlMsg::MozBrowserEvent(parent_pipeline_id, + subpage_id, + event) => self.handle_mozbrowser_event_msg(parent_pipeline_id, subpage_id, event), @@ -727,9 +728,9 @@ impl ScriptTask { old_subpage_id, new_subpage_id) => self.handle_update_subpage_id(containing_pipeline_id, old_subpage_id, new_subpage_id), - ConstellationControlMsg::FocusIFrameMsg(containing_pipeline_id, subpage_id) => + ConstellationControlMsg::FocusIFrame(containing_pipeline_id, subpage_id) => self.handle_focus_iframe_msg(containing_pipeline_id, subpage_id), - ConstellationControlMsg::WebDriverCommandMsg(pipeline_id, msg) => { + ConstellationControlMsg::WebDriverCommand(pipeline_id, msg) => { self.handle_webdriver_msg(pipeline_id, msg); } } @@ -900,7 +901,7 @@ impl ScriptTask { let doc = page.document().root(); let frame_element = self.find_iframe(doc.r(), subpage_id).root(); - if let Some(frame_element) = frame_element { + if let Some(ref frame_element) = frame_element { let element: JSRef<Element> = ElementCast::from_ref(frame_element.r()); doc.r().begin_focus_transaction(); doc.r().request_focus(element); @@ -921,7 +922,7 @@ impl ScriptTask { self.find_iframe(doc.r(), subpage_id) }).root(); - if let Some(frame_element) = frame_element { + if let Some(ref frame_element) = frame_element { frame_element.r().dispatch_mozbrowser_event(event); } } @@ -937,7 +938,7 @@ impl ScriptTask { self.find_iframe(doc.r(), old_subpage_id) }).root(); - frame_element.unwrap().r().update_subpage_id(new_subpage_id); + frame_element.r().unwrap().update_subpage_id(new_subpage_id); } /// Handles a notification that reflow completed. @@ -1305,7 +1306,7 @@ impl ScriptTask { let page = get_page(&self.root_page(), pipeline_id); let document = page.document().root(); match document.r().find_fragment_node(fragment).root() { - Some(node) => { + Some(ref node) => { self.scroll_fragment_point(pipeline_id, node.r()); } None => {} @@ -1324,7 +1325,7 @@ impl ScriptTask { .and_then(|name| document.r().find_fragment_node(name)) .root(); match fragment_node { - Some(node) => self.scroll_fragment_point(pipeline_id, node.r()), + Some(ref node) => self.scroll_fragment_point(pipeline_id, node.r()), None => {} } |