Auto merge of #10225 - jmr0:visibility_api, r=jdm

Implement non-visible pipeline and iframe visibility methods

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

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10225)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-06-16 08:53:56 -05:00 committed by GitHub
commit d620ab71c4
14 changed files with 382 additions and 24 deletions

View file

@ -96,20 +96,24 @@ dictionary BrowserElementOpenWindowEventDetail {
// Element frameElement;
};
dictionary BrowserElementVisibilityChangeEventDetail {
boolean visible;
};
BrowserElement implements BrowserElementCommon;
BrowserElement implements BrowserElementPrivileged;
[NoInterfaceObject]
interface BrowserElementCommon {
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckAnyPermissions="browser embed-widgets"]
//void setVisible(boolean visible);
[Throws,
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser embed-widgets"]
void setVisible(boolean visible);
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",
// CheckAnyPermissions="browser embed-widgets"]
//DOMRequest getVisible();
[Throws,
Pref="dom.mozbrowser.enabled",
CheckAnyPermissions="browser embed-widgets"]
boolean getVisible();
//[Throws,
// Pref="dom.mozBrowserFramesEnabled",