Skip to content
Permalink
Browse files
[Page Visibility API] View-less documents should report as hidden
https://bugs.webkit.org/show_bug.cgi?id=99410

Reviewed by Tony Gentilcore.

Source/WebCore:

Test: fast/events/page-visibility-null-view.html

* dom/Document.cpp:
(WebCore::Document::visibilityState):

LayoutTests:

* fast/events/page-visibility-null-view-expected.txt: Added.
* fast/events/page-visibility-null-view.html: Added.


Canonical link: https://commits.webkit.org/117491@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@131530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
James Simonsen committed Oct 17, 2012
1 parent d2caa21 commit 00814d968273bb4c7bfa4b2dbc9fca4976bb4173
Showing 9 changed files with 61 additions and 3 deletions.
@@ -1,3 +1,13 @@
2012-10-16 James Simonsen <simonjam@chromium.org>

[Page Visibility API] View-less documents should report as hidden
https://bugs.webkit.org/show_bug.cgi?id=99410

Reviewed by Tony Gentilcore.

* fast/events/page-visibility-null-view-expected.txt: Added.
* fast/events/page-visibility-null-view.html: Added.

2012-10-16 Tony Chang <tony@chromium.org>

Unreviewed, broaden Chromium TestExpectations to match waterfall.
@@ -0,0 +1,12 @@
This test checks that Page Visibility state values are correct when a document has no defaultView.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS subdocument.defaultView == null is true
PASS subdocument.webkitVisibilityState is "hidden"
PASS subdocument.webkitHidden is true
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,20 @@
<html>
<head>
<script src="../js/resources/js-test-pre.js"></script>

<script>

description("This test checks that Page Visibility state values are correct when a document has no defaultView.");

var subdocument = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);

shouldBeTrue("subdocument.defaultView == null");
shouldBeEqualToString("subdocument.webkitVisibilityState", "hidden");
shouldBeTrue("subdocument.webkitHidden");

</script>

<script src="../js/resources/js-test-post.js"></script>

</head>
</html>
@@ -268,6 +268,7 @@ webkit.org/b/98942 storage/storageinfo-request-quota.html [ Skip ]
webkit.org/b/97324 fast/events/page-visibility-iframe-delete-test.html [ Skip ]
webkit.org/b/97324 fast/events/page-visibility-iframe-move-test.html [ Skip ]
webkit.org/b/97324 fast/events/page-visibility-iframe-propagation-test.html [ Skip ]
webkit.org/b/97324 fast/events/page-visibility-null-view.html [ Skip ]
webkit.org/b/97324 fast/events/page-visibility-transition-test.html [ Skip ]

# GTK doesn't support smart replace.
@@ -397,6 +397,7 @@ http/tests/navigation/response204.html
fast/events/page-visibility-iframe-delete-test.html
fast/events/page-visibility-iframe-move-test.html
fast/events/page-visibility-iframe-propagation-test.html
fast/events/page-visibility-null-view.html
fast/events/page-visibility-transition-test.html

# console long eval test is timeout 60616
@@ -569,6 +569,7 @@ fast/images/exif-orientation-css.html
fast/events/page-visibility-iframe-delete-test.html
fast/events/page-visibility-iframe-move-test.html
fast/events/page-visibility-iframe-propagation-test.html
fast/events/page-visibility-null-view.html
fast/events/page-visibility-transition-test.html

# No CORS support for media elements is implemented yet.
@@ -1467,6 +1467,7 @@ http/tests/navigation/response204.html
fast/events/page-visibility-iframe-delete-test.html
fast/events/page-visibility-iframe-move-test.html
fast/events/page-visibility-iframe-propagation-test.html
fast/events/page-visibility-null-view.html
fast/events/page-visibility-transition-test.html

# Unskip after implementing LayoutTestController::setDefersLoading and ::goBack.
@@ -1,3 +1,15 @@
2012-10-16 James Simonsen <simonjam@chromium.org>

[Page Visibility API] View-less documents should report as hidden
https://bugs.webkit.org/show_bug.cgi?id=99410

Reviewed by Tony Gentilcore.

Test: fast/events/page-visibility-null-view.html

* dom/Document.cpp:
(WebCore::Document::visibilityState):

2012-10-16 Michael Saboff <msaboff@apple.com>

Change WTF_USE_8BIT_TEXTRUN to ENABLE_8BIT_TEXTRUN
@@ -1624,10 +1624,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();
}

0 comments on commit 00814d9

Please sign in to comment.