[Title] [Page Visibility API] View-less documents should reports as hidden
[Problem] P130814-01392, P130814-01387
[Cause] The default value of visibility is true
[Solution] The visibility of the document is inherited from the visibility of the page. If there is no page associated with the document, we will assume that the page is hidden, as specifed by the spec,
http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#dom-document-hidden
https://bugs.webkit.org/show_bug.cgi?id=99410
Change-Id: Ic1b58eed36fc527d465b15552d972981dce46cae
{
// The visibility of the document is inherited from the visibility of the
// page. If there is no page associated with the document, we will assume
- // that the page is visible i.e. invisibility has to be explicitly
- // specified by the embedder.
+ // that the page is hidden, as specified by the spec:
+ // http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility/Overview.html#dom-document-hidden
if (!m_frame || !m_frame->page())
- return PageVisibilityStateVisible;
+ return PageVisibilityStateHidden;
return m_frame->page()->visibilityState();
}