From 034e815657fced9c3b31d48989be6316ee4f33a8 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 11 Aug 2014 21:27:30 +0200 Subject: [PATCH] Improve the documentation for ScriptMsg. --- src/components/script/script_task.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 0d24eaccbba..ba6cd12c372 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -64,21 +64,27 @@ use std::rc::Rc; local_data_key!(pub StackRoots: *const RootCollection) -/// Messages used to control the script task. +/// Messages used to control script event loops, such as ScriptTask and +/// DedicatedWorkerGlobalScope. pub enum ScriptMsg { - /// Acts on a fragment URL load on the specified pipeline. + /// Acts on a fragment URL load on the specified pipeline (only dispatched + /// to ScriptTask). TriggerFragmentMsg(PipelineId, Url), - /// Begins a content-initiated load on the specified pipeline. + /// Begins a content-initiated load on the specified pipeline (only + /// dispatched to ScriptTask). TriggerLoadMsg(PipelineId, Url), - /// Instructs the script task to send a navigate message to the constellation. + /// Instructs the script task to send a navigate message to + /// the constellation (only dispatched to ScriptTask). NavigateMsg(NavigationDirection), - /// Fires a JavaScript timeout. + /// Fires a JavaScript timeout (only dispatched to ScriptTask). FireTimerMsg(PipelineId, TimerId), - /// Notifies the script that a window associated with a particular pipeline should be closed. + /// Notifies the script that a window associated with a particular pipeline + /// should be closed (only dispatched to ScriptTask). ExitWindowMsg(PipelineId), - /// Notifies the script of progress on a fetch + /// Notifies the script of progress on a fetch (dispatched to all tasks). XHRProgressMsg(TrustedXHRAddress, XHRProgress), - /// Message sent through postMessage + /// Message sent through Worker.postMessage (only dispatched to + /// DedicatedWorkerGlobalScope). DOMMessage(DOMString), }