Source/WebCore/ChangeLog

 12012-10-15 James Simonsen <simonjam@chromium.org>
 2
 3 [Page Visibility API] View-less documents should report as hidden
 4 https://bugs.webkit.org/show_bug.cgi?id=99410
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test: fast/events/page-visibility-null-view.html
 9
 10 * dom/Document.cpp:
 11 (WebCore::Document::visibilityState):
 12
1132012-10-15 Tony Chang <tony@chromium.org>
214
315 Unreviewed, rolling out r131367.

Source/WebCore/dom/Document.cpp

@@PageVisibilityState Document::visibilityState() const
16281628 // that the page is visible i.e. invisibility has to be explicitly
16291629 // specified by the embedder.
16301630 if (!m_frame || !m_frame->page())
1631  return PageVisibilityStateVisible;
 1631 return PageVisibilityStateHidden;
16321632 return m_frame->page()->visibilityState();
16331633}
16341634

LayoutTests/ChangeLog

 12012-10-15 James Simonsen <simonjam@chromium.org>
 2
 3 [Page Visibility API] View-less documents should report as hidden
 4 https://bugs.webkit.org/show_bug.cgi?id=99410
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/events/page-visibility-null-view-expected.txt: Added.
 9 * fast/events/page-visibility-null-view.html: Added.
 10
1112012-10-15 Dana Jansens <danakj@chromium.org>
212
313 Rebaseline after r131358.

LayoutTests/fast/events/page-visibility-null-view-expected.txt

 1This test checks that Page Visibility state values are correct when a document has no defaultView.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS subdocument.defaultView == null is true
 7PASS subdocument.webkitVisibilityState is "hidden"
 8PASS subdocument.webkitHidden is true
 9PASS successfullyParsed is true
 10
 11TEST COMPLETE
 12

LayoutTests/fast/events/page-visibility-null-view.html

 1<html>
 2<head>
 3<script src="../js/resources/js-test-pre.js"></script>
 4
 5<script>
 6
 7description("This test checks that Page Visibility state values are correct when a document has no defaultView.");
 8
 9var subdocument = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);
 10
 11shouldBeTrue("subdocument.defaultView == null");
 12shouldBeEqualToString("subdocument.webkitVisibilityState", "hidden");
 13shouldBeTrue("subdocument.webkitHidden");
 14
 15</script>
 16
 17<script src="../js/resources/js-test-post.js"></script>
 18
 19</head>
 20</html>