diff options
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r-- | components/script_traits/lib.rs | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 56d4406f1ce..d87fdbad5d3 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -18,7 +18,8 @@ extern crate devtools_traits; extern crate euclid; extern crate gfx_traits; extern crate heapsize; -#[macro_use] extern crate heapsize_derive; +#[macro_use] +extern crate heapsize_derive; extern crate hyper; extern crate hyper_serde; extern crate ipc_channel; @@ -252,13 +253,13 @@ pub enum ConstellationControlMsg { /// Report an error from a CSS parser for the given pipeline ReportCSSError(PipelineId, String, usize, usize, String), /// Reload the given page. - Reload(PipelineId) + Reload(PipelineId), } impl fmt::Debug for ConstellationControlMsg { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { use self::ConstellationControlMsg::*; - write!(formatter, "ConstellationMsg::{}", match *self { + let variant = match *self { AttachLayout(..) => "AttachLayout", Resize(..) => "Resize", ResizeInactive(..) => "ResizeInactive", @@ -284,8 +285,9 @@ impl fmt::Debug for ConstellationControlMsg { DispatchStorageEvent(..) => "DispatchStorageEvent", FramedContentChanged(..) => "FramedContentChanged", ReportCSSError(..) => "ReportCSSError", - Reload(..) => "Reload" - }) + Reload(..) => "Reload", + }; + write!(formatter, "ConstellationMsg::{}", variant) } } @@ -383,10 +385,7 @@ pub enum TouchpadPressurePhase { /// Requests a TimerEvent-Message be sent after the given duration. #[derive(Deserialize, Serialize)] -pub struct TimerEventRequest(pub IpcSender<TimerEvent>, - pub TimerSource, - pub TimerEventId, - pub MsDuration); +pub struct TimerEventRequest(pub IpcSender<TimerEvent>, pub TimerSource, pub TimerEventId, pub MsDuration); /// Notifies the script thread to fire due timers. /// `TimerSource` must be `FromWindow` when dispatched to `ScriptThread` and @@ -478,9 +477,7 @@ pub trait ScriptThreadFactory { /// Type of message sent from script to layout. type Message; /// Create a `ScriptThread`. - fn create(state: InitialScriptState, - load_data: LoadData) - -> (Sender<Self::Message>, Receiver<Self::Message>); + fn create(state: InitialScriptState, load_data: LoadData) -> (Sender<Self::Message>, Receiver<Self::Message>); } /// Whether the sandbox attribute is present for an iframe element @@ -489,7 +486,7 @@ pub enum IFrameSandboxState { /// Sandbox attribute is present IFrameSandboxed, /// Sandbox attribute is not present - IFrameUnsandboxed + IFrameUnsandboxed, } /// Specifies the information required to load an iframe. @@ -743,5 +740,5 @@ pub struct WorkerScriptLoadOrigin { /// the referrer policy which is used pub referrer_policy: Option<ReferrerPolicy>, /// the pipeline id of the entity requesting the load - pub pipeline_id: Option<PipelineId> + pub pipeline_id: Option<PipelineId>, } |