servo: Merge #10225 - Implement non-visible pipeline and iframe visibility methods (from jmr0:visibility_api); r=jdm

This addresses #9566 and a good part of #9751, specifically:

* Pipeline has a notion of visibility
* IFrame setVisible/getVisible interface with IFrame's pipeline visibility
* IFrame mozbrowservisibilitychange responds to changes in visibility
* Pipeline visibility is used to limit animations (requestAnimationFrame does not tick animations when hidden) and to increase timer intervals (currently set to a minimum of 1 second while hidden)

Absent for now are any changes to the Document API and general implementation of the Page Visibility API, since the more interesting parts require knowledge of whether the user agent is minimized, OS screen locked, etc.

cc @paulrouget @jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: d620ab71c41431c3fb040162f554faefb9abfbd7
This commit is contained in:
jmr0
2016-06-16 08:53:56 -05:00
parent aa45f4854c
commit 23a90f54a8
11 changed files with 278 additions and 24 deletions

View File

@@ -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