diff options
author | Josh Matthews <josh@joshmatthews.net> | 2018-12-20 16:16:51 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-01-07 22:19:25 -0500 |
commit | 45619db0ba0999d93b5715e1dae0ff49d1088ebe (patch) | |
tree | 5008ee0bf4c228a0eb906296e465f9e8f9b12756 /components/script_traits/script_msg.rs | |
parent | 212ae3b94a869f05a560288a0ec834d143ed7d37 (diff) | |
download | servo-45619db0ba0999d93b5715e1dae0ff49d1088ebe.tar.gz servo-45619db0ba0999d93b5715e1dae0ff49d1088ebe.zip |
Provide the source window as part of postMessage events.
Diffstat (limited to 'components/script_traits/script_msg.rs')
-rw-r--r-- | components/script_traits/script_msg.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 54b52fb33d0..a63462fd83f 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -134,7 +134,16 @@ pub enum ScriptMsg { /// Abort loading after sending a LoadUrl message. AbortLoadUrl, /// Post a message to the currently active window of a given browsing context. - PostMessage(BrowsingContextId, Option<ImmutableOrigin>, Vec<u8>), + PostMessage { + /// The target of the posted message. + target: BrowsingContextId, + /// The source of the posted message. + source: PipelineId, + /// The expected origin of the target. + target_origin: Option<ImmutableOrigin>, + /// The data to be posted. + data: Vec<u8>, + }, /// Inform the constellation that a fragment was navigated to and whether or not it was a replacement navigation. NavigatedToFragment(ServoUrl, bool), /// HTMLIFrameElement Forward or Back traversal. @@ -209,7 +218,7 @@ impl fmt::Debug for ScriptMsg { LoadComplete => "LoadComplete", LoadUrl(..) => "LoadUrl", AbortLoadUrl => "AbortLoadUrl", - PostMessage(..) => "PostMessage", + PostMessage { .. } => "PostMessage", NavigatedToFragment(..) => "NavigatedToFragment", TraverseHistory(..) => "TraverseHistory", PushHistoryState(..) => "PushHistoryState", |