diff options
Diffstat (limited to 'components/script_traits')
-rw-r--r-- | components/script_traits/lib.rs | 9 | ||||
-rw-r--r-- | components/script_traits/script_msg.rs | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs index 07cfaccb84c..cc8a06bf18e 100644 --- a/components/script_traits/lib.rs +++ b/components/script_traits/lib.rs @@ -163,6 +163,10 @@ pub enum ConstellationControlMsg { Freeze(PipelineId), /// Notifies script thread to resume all its timers Thaw(PipelineId), + /// Notifies script thread whether frame is visible + ChangeFrameVisibilityStatus(PipelineId, bool), + /// Notifies script thread that frame visibility change is complete + NotifyVisibilityChange(PipelineId, PipelineId, bool), /// Notifies script thread that a url should be loaded in this iframe. Navigate(PipelineId, SubpageId, LoadData), /// Requests the script thread forward a mozbrowser event to an iframe it owns @@ -451,6 +455,8 @@ pub enum MozBrowserEvent { UsernameAndPasswordRequired, /// Sent when a link to a search engine is found. OpenSearch, + /// Sent when visibility state changes. + VisibilityChange(bool), } impl MozBrowserEvent { @@ -472,7 +478,8 @@ impl MozBrowserEvent { MozBrowserEvent::ShowModalPrompt(_, _, _, _) => "mozbrowsershowmodalprompt", MozBrowserEvent::TitleChange(_) => "mozbrowsertitlechange", MozBrowserEvent::UsernameAndPasswordRequired => "mozbrowserusernameandpasswordrequired", - MozBrowserEvent::OpenSearch => "mozbrowseropensearch" + MozBrowserEvent::OpenSearch => "mozbrowseropensearch", + MozBrowserEvent::VisibilityChange(_) => "mozbrowservisibilitychange", } } } diff --git a/components/script_traits/script_msg.rs b/components/script_traits/script_msg.rs index 241833bc13f..7fc871eb4cc 100644 --- a/components/script_traits/script_msg.rs +++ b/components/script_traits/script_msg.rs @@ -81,6 +81,10 @@ pub enum ScriptMsg { NodeStatus(Option<String>), /// Notification that this iframe should be removed. RemoveIFrame(PipelineId, Option<IpcSender<()>>), + /// Change pipeline visibility + SetVisible(PipelineId, bool), + /// Notifies constellation that an iframe's visibility has been changed. + VisibilityChangeComplete(PipelineId, bool), /// A load has been requested in an IFrame. ScriptLoadedURLInIFrame(IFrameLoadInfo), /// Requests that the constellation set the contents of the clipboard |