aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/lib.rs30
-rw-r--r--components/script_traits/script_msg.rs71
2 files changed, 100 insertions, 1 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 5cbdd8456d7..9ecda6625d6 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -364,7 +364,7 @@ impl fmt::Debug for ConstellationControlMsg {
WebVREvents(..) => "WebVREvents",
PaintMetric(..) => "PaintMetric",
};
- write!(formatter, "ConstellationMsg::{}", variant)
+ write!(formatter, "ConstellationControlMsg::{}", variant)
}
}
@@ -710,6 +710,34 @@ pub enum ConstellationMsg {
SetCursor(CursorKind),
}
+impl fmt::Debug for ConstellationMsg {
+ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ use self::ConstellationMsg::*;
+ let variant = match *self {
+ Exit => "Exit",
+ GetBrowsingContext(..) => "GetBrowsingContext",
+ GetPipeline(..) => "GetPipeline",
+ GetFocusTopLevelBrowsingContext(..) => "GetFocusTopLevelBrowsingContext",
+ IsReadyToSaveImage(..) => "IsReadyToSaveImage",
+ KeyEvent(..) => "KeyEvent",
+ LoadUrl(..) => "LoadUrl",
+ TraverseHistory(..) => "TraverseHistory",
+ WindowSize(..) => "WindowSize",
+ TickAnimation(..) => "TickAnimation",
+ WebDriverCommand(..) => "WebDriverCommand",
+ Reload(..) => "Reload",
+ LogEntry(..) => "LogEntry",
+ WebVREvents(..) => "WebVREvents",
+ NewBrowser(..) => "NewBrowser",
+ CloseBrowser(..) => "CloseBrowser",
+ SelectBrowser(..) => "SelectBrowser",
+ ForwardEvent(..) => "ForwardEvent",
+ SetCursor(..) => "SetCursor",
+ };
+ write!(formatter, "ConstellationMsg::{}", variant)
+ }
+}
+
/// Resources required by workerglobalscopes
#[derive(Clone, Deserialize, Serialize)]
pub struct WorkerGlobalScopeInit {
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs
index d64d47b3eb0..ad437b09d8d 100644
--- a/components/script_traits/script_msg.rs
+++ b/components/script_traits/script_msg.rs
@@ -22,6 +22,7 @@ use net_traits::request::RequestInit;
use net_traits::storage_thread::StorageType;
use servo_url::ImmutableOrigin;
use servo_url::ServoUrl;
+use std::fmt;
use style_traits::CSSPixel;
use style_traits::cursor::CursorKind;
use style_traits::viewport::ViewportConstraints;
@@ -43,6 +44,20 @@ pub enum LayoutMsg {
ViewportConstrained(PipelineId, ViewportConstraints),
}
+impl fmt::Debug for LayoutMsg {
+ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ use self::LayoutMsg::*;
+ let variant = match *self {
+ ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState",
+ IFrameSizes(..) => "IFrameSizes",
+ PendingPaintMetric(..) => "PendingPaintMetric",
+ SetCursor(..) => "SetCursor",
+ ViewportConstrained(..) => "ViewportConstrained",
+ };
+ write!(formatter, "LayoutMsg::{}", variant)
+ }
+}
+
/// Whether a DOM event was prevented by web content
#[derive(Deserialize, Serialize)]
pub enum EventResult {
@@ -172,6 +187,62 @@ pub enum ScriptMsg {
Exit,
}
+impl fmt::Debug for ScriptMsg {
+ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ use self::ScriptMsg::*;
+ let variant = match *self {
+ InitiateNavigateRequest(..) => "InitiateNavigateRequest",
+ BroadcastStorageEvent(..) => "BroadcastStorageEvent",
+ ChangeRunningAnimationsState(..) => "ChangeRunningAnimationsState",
+ CreateCanvasPaintThread(..) => "CreateCanvasPaintThread",
+ Focus => "Focus",
+ GetClipboardContents(..) => "GetClipboardContents",
+ GetBrowsingContextId(..) => "GetBrowsingContextId",
+ GetParentInfo(..) => "GetParentInfo",
+ GetChildBrowsingContextId(..) => "GetChildBrowsingContextId",
+ HeadParsed => "HeadParsed",
+ LoadComplete => "LoadComplete",
+ LoadUrl(..) => "LoadUrl",
+ AbortLoadUrl => "AbortLoadUrl",
+ PostMessage(..) => "PostMessage",
+ TraverseHistory(..) => "TraverseHistory",
+ PushHistoryState(..) => "PushHistoryState",
+ ReplaceHistoryState(..) => "ReplaceHistoryState",
+ JointSessionHistoryLength(..) => "JointSessionHistoryLength",
+ NewFavicon(..) => "NewFavicon",
+ NodeStatus(..) => "NodeStatus",
+ RemoveIFrame(..) => "RemoveIFrame",
+ SetVisible(..) => "SetVisible",
+ VisibilityChangeComplete(..) => "VisibilityChangeComplete",
+ ScriptLoadedURLInIFrame(..) => "ScriptLoadedURLInIFrame",
+ ScriptNewIFrame(..) => "ScriptNewIFrame",
+ SetClipboardContents(..) => "SetClipboardContents",
+ ActivateDocument => "ActivateDocument",
+ SetDocumentState(..) => "SetDocumentState",
+ SetFinalUrl(..) => "SetFinalUrl",
+ Alert(..) => "Alert",
+ SetTitle(..) => "SetTitle",
+ SendKeyEvent(..) => "SendKeyEvent",
+ MoveTo(..) => "MoveTo",
+ ResizeTo(..) => "ResizeTo",
+ TouchEventProcessed(..) => "TouchEventProcessed",
+ LogEntry(..) => "LogEntry",
+ DiscardDocument => "DiscardDocument",
+ PipelineExited => "PipelineExited",
+ ForwardDOMMessage(..) => "ForwardDOMMessage",
+ RegisterServiceWorker(..) => "RegisterServiceWorker",
+ SetFullscreenState(..) => "SetFullscreenState",
+ GetClientWindow(..) => "GetClientWindow",
+ GetScreenSize(..) => "GetScreenSize",
+ GetScreenAvailSize(..) => "GetScreenAvailSize",
+ ShowIME(..) => "ShowIME",
+ HideIME => "HideIME",
+ Exit => "Exit",
+ };
+ write!(formatter, "ScriptMsg::{}", variant)
+ }
+}
+
/// Entities required to spawn service workers
#[derive(Clone, Deserialize, Serialize)]
pub struct ScopeThings {