Commit 5fbf1940 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

2011-06-06 Shishir Agrawal <shishir@chromium.org>

        Reviewed by Tony Gentilcore.

        Add a "prerender" state for page visibility.
        https://bugs.webkit.org/show_bug.cgi?id=62062

        * fast/events/page-visibility-transition-test-expected.txt:
        * fast/events/page-visibility-transition-test.html:
2011-06-06  Shishir Agrawal  <shishir@chromium.org>

        Reviewed by Tony Gentilcore.

        Add a "prerender" state for page visibility.
        https://bugs.webkit.org/show_bug.cgi?id=62062

        * page/PageVisibilityState.cpp:
        (WebCore::pageVisibilityStateString):
        * page/PageVisibilityState.h:
2011-06-06  Shishir Agrawal  <shishir@chromium.org>

        Reviewed by Tony Gentilcore.

        Add a "prerender" state for page visibility.
        https://bugs.webkit.org/show_bug.cgi?id=62062

        * public/WebPageVisibilityState.h:
        * src/AssertMatchingEnums.cpp:
        * src/WebViewImpl.cpp:
        (WebKit::WebViewImpl::setVisibilityState):
2011-06-06  Shishir Agrawal  <shishir@chromium.org>

        Reviewed by Tony Gentilcore.

        Add a "prerender" state for page visibility.
        https://bugs.webkit.org/show_bug.cgi?id=62062

        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::setPageVisibility):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@88174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent de3a618e
2011-06-06 Shishir Agrawal <shishir@chromium.org>
Reviewed by Tony Gentilcore.
Add a "prerender" state for page visibility.
https://bugs.webkit.org/show_bug.cgi?id=62062
* fast/events/page-visibility-transition-test-expected.txt:
* fast/events/page-visibility-transition-test.html:
2011-06-06 Csaba Osztrogonác <ossy@webkit.org>
[Qt] 6 tests have different results on 64 bit compared to 32 bit
......
......@@ -9,6 +9,8 @@ PASS document.webkitVisibilityState is "hidden"
PASS document.webkitHidden is true
PASS document.webkitVisibilityState is "hidden"
PASS document.webkitHidden is true
PASS document.webkitVisibilityState is "prerender"
PASS document.webkitHidden is true
PASS document.webkitVisibilityState is "visible"
PASS document.webkitHidden is false
PASS successfullyParsed is true
......
......@@ -22,6 +22,11 @@ function makePageHidden() {
layoutTestController.setPageVisibility("hidden");
}
function makePagePrerender() {
if (window.layoutTestController)
layoutTestController.setPageVisibility("prerender");
}
function checkIsPageVisible() {
shouldBeEqualToString("document.webkitVisibilityState", "visible");
shouldBeFalse("document.webkitHidden");
......@@ -32,11 +37,17 @@ function checkIsPageHidden() {
shouldBeTrue("document.webkitHidden");
}
function checkIsPagePrerendering() {
shouldBeEqualToString("document.webkitVisibilityState", "prerender");
shouldBeTrue("document.webkitHidden");
}
// We will try to change the visibility states as:
// 0 - visible. (Initial - i.e. on load).
// 1 - hidden (should fire event).
// 2 - hidden (no event).
// 3 - visible (should fire event).
// 3 - prerender (should fire event).
// 4 - visible (should fire event).
var numVisibilityChanges = 0;
function startTest() {
......@@ -61,13 +72,18 @@ function onVisibilityChange() {
makePageHidden();
checkIsPageHidden();
numVisibilityChanges++;
makePageVisible();
makePagePrerender();
return;
} else if (numVisibilityChanges == 2) {
testFailed("Invalid event fired on same state change.");
finishTest();
return;
} else if (numVisibilityChanges == 3) {
checkIsPagePrerendering();
numVisibilityChanges++;
makePageVisible();
return;
} else if (numVisibilityChanges == 4) {
checkIsPageVisible();
numVisibilityChanges++;
finishTest();
......
2011-06-06 Shishir Agrawal <shishir@chromium.org>
Reviewed by Tony Gentilcore.
Add a "prerender" state for page visibility.
https://bugs.webkit.org/show_bug.cgi?id=62062
* page/PageVisibilityState.cpp:
(WebCore::pageVisibilityStateString):
* page/PageVisibilityState.h:
2011-06-06 Cary Clark <caryclark@google.com>
Reviewed by Eric Seidel.
......
......@@ -39,12 +39,15 @@ String pageVisibilityStateString(PageVisibilityState state)
{
DEFINE_STATIC_LOCAL(const String, visible, ("visible"));
DEFINE_STATIC_LOCAL(const String, hidden, ("hidden"));
DEFINE_STATIC_LOCAL(const String, prerender, ("prerender"));
switch (state) {
case PageVisibilityStateVisible:
return visible;
case PageVisibilityStateHidden:
return hidden;
case PageVisibilityStatePrerender:
return prerender;
}
ASSERT_NOT_REACHED();
......
......@@ -39,7 +39,8 @@ namespace WebCore {
// without flag protection.
enum PageVisibilityState {
PageVisibilityStateVisible,
PageVisibilityStateHidden
PageVisibilityStateHidden,
PageVisibilityStatePrerender
};
#if ENABLE(PAGE_VISIBILITY_API)
......
2011-06-06 Shishir Agrawal <shishir@chromium.org>
Reviewed by Tony Gentilcore.
Add a "prerender" state for page visibility.
https://bugs.webkit.org/show_bug.cgi?id=62062
* public/WebPageVisibilityState.h:
* src/AssertMatchingEnums.cpp:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setVisibilityState):
2011-06-06 Nico Weber <thakis@chromium.org>
Reviewed by Dimitri Glazkov.
......
......@@ -37,7 +37,8 @@ namespace WebKit {
// defined in WebCore.
enum WebPageVisibilityState {
WebPageVisibilityStateVisible,
WebPageVisibilityStateHidden
WebPageVisibilityStateHidden,
WebPageVisibilityStatePrerender
};
} // namespace WebKit
......
......@@ -457,3 +457,4 @@ COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::ScrollbarParentRenderLayer, Platfor
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateVisible, PageVisibilityStateVisible);
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateHidden, PageVisibilityStateHidden);
COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStatePrerender, PageVisibilityStatePrerender);
......@@ -2588,7 +2588,9 @@ void WebViewImpl::setVisibilityState(WebPageVisibilityState visibilityState,
if (!page())
return;
ASSERT(visibilityState == WebPageVisibilityStateVisible || visibilityState == WebPageVisibilityStateHidden);
ASSERT(visibilityState == WebPageVisibilityStateVisible
|| visibilityState == WebPageVisibilityStateHidden
|| visibilityState == WebPageVisibilityStatePrerender);
m_page->setVisibilityState(static_cast<PageVisibilityState>(static_cast<int>(visibilityState)), isInitialState);
#endif
}
......
2011-06-06 Shishir Agrawal <shishir@chromium.org>
Reviewed by Tony Gentilcore.
Add a "prerender" state for page visibility.
https://bugs.webkit.org/show_bug.cgi?id=62062
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::setPageVisibility):
2011-06-06 Csaba Osztrogonác <ossy@webkit.org>
 
[Qt] Implement download feature for QtTestBrowser
......
......@@ -1869,6 +1869,8 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C
m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible, false);
else if (newVisibility == "hidden")
m_shell->webView()->setVisibilityState(WebPageVisibilityStateHidden, false);
else if (newVisibility == "prerender")
m_shell->webView()->setVisibilityState(WebPageVisibilityStatePrerender, false);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment