diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 4cf005c93f2..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,7 +253,7 @@ 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 { @@ -284,7 +285,7 @@ impl fmt::Debug for ConstellationControlMsg { DispatchStorageEvent(..) => "DispatchStorageEvent", FramedContentChanged(..) => "FramedContentChanged", ReportCSSError(..) => "ReportCSSError", - Reload(..) => "Reload" + Reload(..) => "Reload", }; write!(formatter, "ConstellationMsg::{}", variant) } @@ -384,10 +385,7 @@ pub enum TouchpadPressurePhase { /// Requests a TimerEvent-Message be sent after the given duration. #[derive(Deserialize, Serialize)] -pub struct TimerEventRequest(pub IpcSender, - pub TimerSource, - pub TimerEventId, - pub MsDuration); +pub struct TimerEventRequest(pub IpcSender, pub TimerSource, pub TimerEventId, pub MsDuration); /// Notifies the script thread to fire due timers. /// `TimerSource` must be `FromWindow` when dispatched to `ScriptThread` and @@ -479,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, Receiver); + fn create(state: InitialScriptState, load_data: LoadData) -> (Sender, Receiver); } /// Whether the sandbox attribute is present for an iframe element @@ -490,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. @@ -744,5 +740,5 @@ pub struct WorkerScriptLoadOrigin { /// the referrer policy which is used pub referrer_policy: Option, /// the pipeline id of the entity requesting the load - pub pipeline_id: Option + pub pipeline_id: Option, } diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 80dbc3f4165..e268d67bc1d 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -57,7 +57,7 @@ pub enum LogEntry { /// Error, with a reason Error(String), /// warning, with a reason - Warn(String) + Warn(String), } /// Messages from the script to the constellation. @@ -148,7 +148,7 @@ pub enum ScriptMsg { /// Enter or exit fullscreen SetFullscreenState(bool), /// Requests that the compositor shut down. - Exit + Exit, } /// Entities required to spawn service workers @@ -175,7 +175,7 @@ pub struct SWManagerSenders { /// sender for communicating with constellation pub swmanager_sender: IpcSender, /// sender for communicating with resource thread - pub resource_sender: IpcSender + pub resource_sender: IpcSender, } /// Messages sent to Service Worker Manager thread @@ -195,6 +195,5 @@ pub enum ServiceWorkerMsg { #[derive(Deserialize, Serialize)] pub enum SWManagerMsg { /// Provide the constellation with a means of communicating with the Service Worker Manager - OwnSender(IpcSender) - + OwnSender(IpcSender), } diff --git a/components/script_traits/webdriver_msg.rs b/components/script_traits/webdriver_msg.rs index c197b0dfc18..9fe9e9b80f5 100644 --- a/components/script_traits/webdriver_msg.rs +++ b/components/script_traits/webdriver_msg.rs @@ -15,7 +15,7 @@ use servo_url::ServoUrl; #[derive(Deserialize, Serialize)] pub enum WebDriverScriptCommand { AddCookie(#[serde(deserialize_with = "::hyper_serde::deserialize", - serialize_with = "::hyper_serde::serialize")] + serialize_with = "::hyper_serde::serialize")] Cookie, IpcSender>), ExecuteScript(String, IpcSender), @@ -35,13 +35,13 @@ pub enum WebDriverScriptCommand { GetUrl(IpcSender), IsEnabled(String, IpcSender>), IsSelected(String, IpcSender>), - GetTitle(IpcSender) + GetTitle(IpcSender), } #[derive(Deserialize, Serialize)] pub enum WebDriverCookieError { InvalidDomain, - UnableToSetCookie + UnableToSetCookie, } #[derive(Deserialize, Serialize)] @@ -50,8 +50,7 @@ pub enum WebDriverJSValue { Null, Boolean(bool), Number(f64), - String(String), - // TODO: Object and WebElement + String(String), // TODO: Object and WebElement } #[derive(Deserialize, Serialize)] @@ -60,7 +59,7 @@ pub enum WebDriverJSError { UnknownType, /// Occurs when handler received an event message for a layout channel that is not /// associated with the current script thread - BrowsingContextNotFound + BrowsingContextNotFound, } pub type WebDriverJSResult = Result; @@ -69,7 +68,7 @@ pub type WebDriverJSResult = Result; pub enum WebDriverFrameId { Short(u16), Element(String), - Parent + Parent, } impl ToJson for WebDriverJSValue { @@ -79,7 +78,7 @@ impl ToJson for WebDriverJSValue { WebDriverJSValue::Null => Json::Null, WebDriverJSValue::Boolean(ref x) => x.to_json(), WebDriverJSValue::Number(ref x) => x.to_json(), - WebDriverJSValue::String(ref x) => x.to_json() + WebDriverJSValue::String(ref x) => x.to_json(), } } } @@ -87,5 +86,5 @@ impl ToJson for WebDriverJSValue { #[derive(Deserialize, Serialize)] pub enum LoadStatus { LoadComplete, - LoadTimeout + LoadTimeout, }