Implement non-visible pipeline and iframe visibility methods

This commit is contained in:
jmr0 2016-03-09 01:24:46 -05:00
parent ce88b8ed30
commit 2bff131535
14 changed files with 382 additions and 24 deletions

View file

@ -133,6 +133,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
@ -421,6 +425,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 {
@ -442,7 +448,8 @@ impl MozBrowserEvent {
MozBrowserEvent::ShowModalPrompt(_, _, _, _) => "mozbrowsershowmodalprompt",
MozBrowserEvent::TitleChange(_) => "mozbrowsertitlechange",
MozBrowserEvent::UsernameAndPasswordRequired => "mozbrowserusernameandpasswordrequired",
MozBrowserEvent::OpenSearch => "mozbrowseropensearch"
MozBrowserEvent::OpenSearch => "mozbrowseropensearch",
MozBrowserEvent::VisibilityChange(_) => "mozbrowservisibilitychange",
}
}
}