[CherryPick] [Page Visibility API] View-less documents should reports as hidden
authorJiyeon Kim <jiyeon0402.kim@samsung.com>
Wed, 14 Aug 2013 12:00:25 +0000 (21:00 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 27 Aug 2013 05:37:22 +0000 (05:37 +0000)
[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

Source/WebCore/dom/Document.cpp

index c358d59..3a28f49 100755 (executable)
@@ -1636,10 +1636,10 @@ PageVisibilityState Document::visibilityState() const
 {
     // 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();
 }