Title: [88174] trunk
Revision
88174
Author
[email protected]
Date
2011-06-06 11:03:05 -0700 (Mon, 06 Jun 2011)

Log Message

2011-06-06  Shishir Agrawal  <[email protected]>

        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  <[email protected]>

        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  <[email protected]>

        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  <[email protected]>

        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):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88173 => 88174)


--- trunk/LayoutTests/ChangeLog	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/LayoutTests/ChangeLog	2011-06-06 18:03:05 UTC (rev 88174)
@@ -1,3 +1,13 @@
+2011-06-06  Shishir Agrawal  <[email protected]>
+
+        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  <[email protected]>
 
         [Qt] 6 tests have different results on 64 bit compared to 32 bit

Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt (88173 => 88174)


--- trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt	2011-06-06 18:03:05 UTC (rev 88174)
@@ -9,6 +9,8 @@
 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

Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test.html (88173 => 88174)


--- trunk/LayoutTests/fast/events/page-visibility-transition-test.html	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test.html	2011-06-06 18:03:05 UTC (rev 88174)
@@ -22,6 +22,11 @@
         layoutTestController.setPageVisibility("hidden");
 }
 
+function makePagePrerender() {
+    if (window.layoutTestController)
+        layoutTestController.setPageVisibility("prerender");
+}
+
 function checkIsPageVisible() {
     shouldBeEqualToString("document.webkitVisibilityState", "visible");
     shouldBeFalse("document.webkitHidden");
@@ -32,11 +37,17 @@
     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 @@
         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();

Modified: trunk/Source/WebCore/ChangeLog (88173 => 88174)


--- trunk/Source/WebCore/ChangeLog	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebCore/ChangeLog	2011-06-06 18:03:05 UTC (rev 88174)
@@ -1,3 +1,14 @@
+2011-06-06  Shishir Agrawal  <[email protected]>
+
+        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  <[email protected]>
 
         Reviewed by Eric Seidel.

Modified: trunk/Source/WebCore/page/PageVisibilityState.cpp (88173 => 88174)


--- trunk/Source/WebCore/page/PageVisibilityState.cpp	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebCore/page/PageVisibilityState.cpp	2011-06-06 18:03:05 UTC (rev 88174)
@@ -39,12 +39,15 @@
 {
     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();

Modified: trunk/Source/WebCore/page/PageVisibilityState.h (88173 => 88174)


--- trunk/Source/WebCore/page/PageVisibilityState.h	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebCore/page/PageVisibilityState.h	2011-06-06 18:03:05 UTC (rev 88174)
@@ -39,7 +39,8 @@
 // without flag protection.
 enum PageVisibilityState {
     PageVisibilityStateVisible,
-    PageVisibilityStateHidden
+    PageVisibilityStateHidden,
+    PageVisibilityStatePrerender
 };
 
 #if ENABLE(PAGE_VISIBILITY_API)

Modified: trunk/Source/WebKit/chromium/ChangeLog (88173 => 88174)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-06-06 18:03:05 UTC (rev 88174)
@@ -1,3 +1,15 @@
+2011-06-06  Shishir Agrawal  <[email protected]>
+
+        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  <[email protected]>
 
         Reviewed by Dimitri Glazkov.

Modified: trunk/Source/WebKit/chromium/public/WebPageVisibilityState.h (88173 => 88174)


--- trunk/Source/WebKit/chromium/public/WebPageVisibilityState.h	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebKit/chromium/public/WebPageVisibilityState.h	2011-06-06 18:03:05 UTC (rev 88174)
@@ -37,7 +37,8 @@
 // defined in WebCore.
 enum WebPageVisibilityState {
     WebPageVisibilityStateVisible,
-    WebPageVisibilityStateHidden
+    WebPageVisibilityStateHidden,
+    WebPageVisibilityStatePrerender
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (88173 => 88174)


--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2011-06-06 18:03:05 UTC (rev 88174)
@@ -457,3 +457,4 @@
 
 COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateVisible, PageVisibilityStateVisible);
 COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStateHidden, PageVisibilityStateHidden);
+COMPILE_ASSERT_MATCHING_ENUM(WebPageVisibilityStatePrerender, PageVisibilityStatePrerender);

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (88173 => 88174)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-06-06 18:03:05 UTC (rev 88174)
@@ -2588,7 +2588,9 @@
     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
 }

Modified: trunk/Tools/ChangeLog (88173 => 88174)


--- trunk/Tools/ChangeLog	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Tools/ChangeLog	2011-06-06 18:03:05 UTC (rev 88174)
@@ -1,3 +1,13 @@
+2011-06-06  Shishir Agrawal  <[email protected]>
+
+        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  <[email protected]>
 
         [Qt] Implement download feature for QtTestBrowser

Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (88173 => 88174)


--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2011-06-06 18:01:15 UTC (rev 88173)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp	2011-06-06 18:03:05 UTC (rev 88174)
@@ -1869,6 +1869,8 @@
             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);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to