diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-07-08 01:20:28 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-07-08 01:20:28 -0600 |
commit | 5386b0122c52a2e869065676d46b242a4ddd1726 (patch) | |
tree | 77b897709e27fd3f76918a9b0adb57c050ba7a81 /components/script_traits/lib.rs | |
parent | effe569e32d33d5c6c95d0882487b6ea128fd71b (diff) | |
parent | 417305d71950e7b061706146950e3f19988b92fc (diff) | |
download | servo-5386b0122c52a2e869065676d46b242a4ddd1726.tar.gz servo-5386b0122c52a2e869065676d46b242a4ddd1726.zip |
Auto merge of #6575 - Ms2ger:script-traits-docs, r=jdm
Really require documentation in the script_traits crate.
My previous attempt (1303dd6e2e1af39b13b57986f154a67f9e7490e7) was foiled by
a typo that made the requirement only apply to the next item.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6575)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r-- | components/script_traits/lib.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 20fe580fdba..f8c5ccc9d90 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -6,7 +6,7 @@ //! The traits are here instead of in script so that these modules won't have //! to depend on script. -#[deny(missing_docs)] +#![deny(missing_docs)] extern crate devtools_traits; extern crate euclid; @@ -55,14 +55,19 @@ pub struct NewLayoutInfo { pub load_data: LoadData, } +/// `StylesheetLoadResponder` is used to notify a responder that a style sheet +/// has loaded. pub trait StylesheetLoadResponder { + /// Respond to a loaded style sheet. fn respond(self: Box<Self>); } /// Used to determine if a script has any pending asynchronous activity. #[derive(Copy, Clone, Debug, PartialEq)] pub enum ScriptState { + /// The document has been loaded. DocumentLoaded, + /// The document is still loading. DocumentLoading, } @@ -96,7 +101,7 @@ pub enum ConstellationControlMsg { UpdateSubpageId(PipelineId, SubpageId, SubpageId), /// Set an iframe to be focused. Used when an element in an iframe gains focus. FocusIFrame(PipelineId, SubpageId), - // Passes a webdriver command to the script task for execution + /// Passes a webdriver command to the script task for execution WebDriverScriptCommand(PipelineId, WebDriverScriptCommand), /// Notifies script task that all animations are done TickAllAnimations(PipelineId), @@ -141,7 +146,10 @@ pub struct OpaqueScriptLayoutChannel(pub (Box<Any+Send>, Box<Any+Send>)); #[derive(Clone)] pub struct ScriptControlChan(pub Sender<ConstellationControlMsg>); +/// This trait allows creating a `ScriptTask` without depending on the `script` +/// crate. pub trait ScriptTaskFactory { + /// Create a `ScriptTask`. fn create<C>(_phantom: Option<&mut Self>, id: PipelineId, parent_info: Option<(PipelineId, SubpageId)>, @@ -158,7 +166,9 @@ pub trait ScriptTaskFactory { window_size: Option<WindowSizeData>, load_data: LoadData) where C: ScriptListener + Send; + /// Create a script -> layout channel (`Sender`, `Receiver` pair). fn create_layout_channel(_phantom: Option<&mut Self>) -> OpaqueScriptLayoutChannel; + /// Clone the `Sender` in `pair`. fn clone_layout_channel(_phantom: Option<&mut Self>, pair: &OpaqueScriptLayoutChannel) -> Box<Any+Send>; } |