diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2018-03-18 13:20:24 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2018-05-05 19:14:36 +0800 |
commit | 427eaed535dfdeaf735a40e3cb82ad7077aa86c5 (patch) | |
tree | cc723041b13093541e8d5986b74bbd02e1c920a6 /components/script_traits | |
parent | a1d1b187102b340ba65955f2c4f1131c8276d050 (diff) | |
download | servo-427eaed535dfdeaf735a40e3cb82ad7077aa86c5.tar.gz servo-427eaed535dfdeaf735a40e3cb82ad7077aa86c5.zip |
beforeunload and unload infrastructure
Diffstat (limited to 'components/script_traits')
-rw-r--r-- | components/script_traits/lib.rs | 3 | ||||
-rw-r--r-- | components/script_traits/script_msg.rs | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 98cf57116a7..5cbdd8456d7 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -262,6 +262,8 @@ pub enum ConstellationControlMsg { Resize(PipelineId, WindowSizeData, WindowSizeType), /// Notifies script that window has been resized but to not take immediate action. ResizeInactive(PipelineId, WindowSizeData), + /// Notifies the script that the document associated with this pipeline should 'unload'. + UnloadDocument(PipelineId), /// Notifies the script that a pipeline should be closed. ExitPipeline(PipelineId, DiscardBrowsingContext), /// Notifies the script that the whole thread should be closed. @@ -335,6 +337,7 @@ impl fmt::Debug for ConstellationControlMsg { AttachLayout(..) => "AttachLayout", Resize(..) => "Resize", ResizeInactive(..) => "ResizeInactive", + UnloadDocument(..) => "UnloadDocument", ExitPipeline(..) => "ExitPipeline", ExitScriptThread => "ExitScriptThread", SendEvent(..) => "SendEvent", diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index efc368e0761..379c73b66b2 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -148,6 +148,8 @@ pub enum ScriptMsg { TouchEventProcessed(EventResult), /// A log entry, with the top-level browsing context id and thread name LogEntry(Option<String>, LogEntry), + /// Discard the document. + DiscardDocument, /// Notifies the constellation that this pipeline has exited. PipelineExited, /// Send messages from postMessage calls from serviceworker |