<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161105] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161105">161105</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2013-12-27 11:46:00 -0800 (Fri, 27 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=126214

Reviewed by Alexey Proskuryakov.

WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
state also tracks the prerender state - so split this out and handle it separately (a change
we should make in WebCore, too).

Source/WebCore: 

WebCore - changes the API tests exposed a bug, a view should only ever come out of the
prerender state when it becomes visible - redundant notifications that the view is still
hidden should be ignored.

* page/Page.cpp:
(WebCore::Page::setVisibilityState):
    - ignore visibility state change to hidden, if the current state is prerender.

Source/WebKit2: 

Removing the redundancy also removes the ability from the API to set a fake visibility state
(IsVisible tracks the actual visibility of the view). Through private API
(WKPageSetVisibilityState) a client could previously request the view be reported as hidden or
visible, but this didn't really work - the override was not enforced and the API may reset the
state at an arbitrary point. The mechanism is only used by testing code, which instead should
actually update the view visibility (this tests more of the actual visibility mechanisms used
by the browser). The one aspect of the API relied on by existing clients is the ability to
initialize a hidden view as prerender - continue to support this specific functionality via
WKPageSetVisibilityState, to maintain backwards compatibility.

- WebKit2 - remove internal state that tracks page visibility separately from the view state
visibility. For backwards compatibility continue to support the WKPageSetVisibilityState API,
but only to initialize the state to prerender.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetVisibilityState):
    - only support initializing the visibility state to prerender.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
    - remove m_visibilityState
(WebKit::WebPageProxy::initializeWebPage):
    - no need to send initial visibility state (this is sent as a part of the creation parameters).
(WebKit::WebPageProxy::viewStateDidChange):
    - no need to send visibility state change (this is sent as a part of view state).
(WebKit::WebPageProxy::setVisibilityStatePrerender):
    - setVisibilityState -&gt; setVisibilityStatePrerender.
* UIProcess/WebPageProxy.h:
    - remove m_visibilityState, setVisibilityState -&gt; setVisibilityStatePrerender.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
    - added call to updateVisibilityState.
(WebKit::WebPage::setViewIsVisible):
    - added call to updateVisibilityState.
(WebKit::WebPage::updateVisibilityState):
    - previously setVisibilityState, updates the page visibility state according to the view state.
(WebKit::WebPage::setVisibilityStatePrerender):
    - set visibility state to prerender.
* WebProcess/WebPage/WebPage.h:
    - remove m_visibilityState, setVisibilityState -&gt; setVisibilityStatePrerender.
* WebProcess/WebPage/WebPage.messages.in:
    - SetVisibilityState -&gt; SetVisibilityStatePrerender.

Tools: 

Tools - WebKit2 no longer (poorly) supports a fake visibility state, so to test the page
visibility mechanisms we should actually be changing characteristics of the view that will
be detected by WebKit2 as a visibility change. This affects three things:
    1) On setVisibilityState WebKitTestRunner must actually change visibility of the view.
    2) The 'PageVisibilityState' test in the API tests is useless (as evidenced by the fact
       that page visibility has been broken in WebKit2 for a couple of months, and didn't
       catch this fact). Removed in favour of:
    3) 'PageVisibilityStateWithWindowChanges' - this is the good stuff. This actually tests
       the visibility mechanism. Beef this test up by adding coverage for: a) the prerender
    state, b) document.hidden, and c) too many state change notifications (it already looks
    for too few).

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp: Removed.
    - Removed PageVisibilityState - this test was ineffective, API no longer supports this
      test, and behaviour is covered by PageVisibilityStateWithWindowChanges.
* TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
(-[PageVisibilityStateDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]):
(runJavaScriptAlert):
    - Add checking for too many calls to the alert.
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::setPrerender):
    - Added methods to set visibility to prerender.
(TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
    - Added checking of 'document.hidden'.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setVisibilityState):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/efl/TestControllerEfl.cpp:
(WTR::TestController::setHidden):
* WebKitTestRunner/gtk/TestControllerGtk.cpp:
(WTR::TestController::setHidden):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::setHidden):
    - Add setHidden method; call this from setVisibilityState.

LayoutTests: 

LayoutTests - remove test for notification on visibility state change to preerender. This test
was covering something nonsensical, and not supported by the spec - the page should never see
a visibility change to prerender, this should only be an initial state. WebKit2 API now only
allows the client to change the state to prerender without sending a notification, and there
is no sense in continuing to support the current test case, since the behaviour is neither
allowed by API nor available in web content.

The prerender state is now properly covered by API tests.

* fast/events/page-visibility-transition-test-expected.txt:
* fast/events/page-visibility-transition-test.html:
    - remove test for notification on visibility state change to preerender.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasteventspagevisibilitytransitiontestexpectedtxt">trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventspagevisibilitytransitiontesthtml">trunk/LayoutTests/fast/events/page-visibility-transition-test.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagecpp">trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIGNUmakefileam">trunk/Tools/TestWebKitAPI/GNUmakefile.am</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformEflcmake">trunk/Tools/TestWebKitAPI/PlatformEfl.cmake</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsmacPageVisibilityStateWithWindowChangesmm">trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/WebKitTestRunner/TestController.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/WebKitTestRunner/TestController.h</a></li>
<li><a href="#trunkToolsWebKitTestRunnereflTestControllerEflcpp">trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnergtkTestControllerGtkcpp">trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacTestControllerMacmm">trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2PageVisibilityStatecpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/LayoutTests/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=126214
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
+        state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
+        state also tracks the prerender state - so split this out and handle it separately (a change
+        we should make in WebCore, too).
+
+        LayoutTests - remove test for notification on visibility state change to preerender. This test
+        was covering something nonsensical, and not supported by the spec - the page should never see
+        a visibility change to prerender, this should only be an initial state. WebKit2 API now only
+        allows the client to change the state to prerender without sending a notification, and there
+        is no sense in continuing to support the current test case, since the behaviour is neither
+        allowed by API nor available in web content.
+
+        The prerender state is now properly covered by API tests.
+
+        * fast/events/page-visibility-transition-test-expected.txt:
+        * fast/events/page-visibility-transition-test.html:
+            - remove test for notification on visibility state change to preerender.
+
</ins><span class="cx"> 2013-12-25  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r161033 and r161074.
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventspagevisibilitytransitiontestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test-expected.txt        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -9,8 +9,6 @@
</span><span class="cx"> PASS document.hidden is true
</span><span class="cx"> PASS document.visibilityState is &quot;hidden&quot;
</span><span class="cx"> PASS document.hidden is true
</span><del>-PASS document.visibilityState is &quot;prerender&quot;
-PASS document.hidden is true
</del><span class="cx"> PASS document.visibilityState is &quot;visible&quot;
</span><span class="cx"> PASS document.hidden is false
</span><span class="cx"> PASS successfullyParsed is true
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventspagevisibilitytransitiontesthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/events/page-visibility-transition-test.html (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/page-visibility-transition-test.html        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/LayoutTests/fast/events/page-visibility-transition-test.html        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -39,24 +39,11 @@
</span><span class="cx">     shouldBeTrue(&quot;document.hidden&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function checkIsPagePrerendering() {
-    shouldBeEqualToString(&quot;document.visibilityState&quot;, &quot;prerender&quot;);
-    shouldBeTrue(&quot;document.hidden&quot;);
-}
-
-function checkIsPageInUnloaded() {
-    shouldBeEqualToString(&quot;document.visibilityState&quot;, &quot;unloaded&quot;);
-    shouldBeTrue(&quot;document.hidden&quot;);
-}
-
</del><span class="cx"> // We will try to change the visibility states as:
</span><span class="cx"> //  0 - visible. (Initial - i.e. on load).
</span><span class="cx"> //  1 - hidden (should fire event).
</span><span class="cx"> //  2 - hidden (no event).
</span><del>-//  3 - prerender (should fire event).
-//  4 - visible (should fire event).
-//  5 - unloaded (should fire event).
-//  6 - visible (should fire event).
</del><ins>+//  3 - visible (should fire event).
</ins><span class="cx"> var numVisibilityChanges = 0;
</span><span class="cx"> 
</span><span class="cx"> function startTest() {
</span><span class="lines">@@ -81,18 +68,13 @@
</span><span class="cx">         makePageHidden();
</span><span class="cx">         checkIsPageHidden();
</span><span class="cx">         numVisibilityChanges++;
</span><del>-        makePagePrerender();
</del><ins>+        makePageVisible();
</ins><span class="cx">         return;
</span><span class="cx">     } else if (numVisibilityChanges == 2) {
</span><span class="cx">         testFailed(&quot;Invalid event fired on same state change.&quot;);
</span><span class="cx">         finishTest();
</span><span class="cx">         return;
</span><span class="cx">     } else if (numVisibilityChanges == 3) {
</span><del>-        checkIsPagePrerendering();
-        numVisibilityChanges++;
-        makePageVisible();
-        return;
-    } else if (numVisibilityChanges == 4) {
</del><span class="cx">         checkIsPageVisible();
</span><span class="cx">         numVisibilityChanges++;
</span><span class="cx">         finishTest();
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebCore/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=126214
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
+        state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
+        state also tracks the prerender state - so split this out and handle it separately (a change
+        we should make in WebCore, too).
+
+        WebCore - changes the API tests exposed a bug, a view should only ever come out of the
+        prerender state when it becomes visible - redundant notifications that the view is still
+        hidden should be ignored.
+
+        * page/Page.cpp:
+        (WebCore::Page::setVisibilityState):
+            - ignore visibility state change to hidden, if the current state is prerender.
+
</ins><span class="cx"> 2013-12-27  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed Windows build fix for r160946.
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebCore/page/Page.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1246,6 +1246,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_visibilityState == visibilityState)
</span><span class="cx">         return;
</span><ins>+    if (m_visibilityState == PageVisibilityStatePrerender &amp;&amp; visibilityState == PageVisibilityStateHidden)
+        return;
</ins><span class="cx">     m_visibilityState = visibilityState;
</span><span class="cx"> 
</span><span class="cx">     if (!isInitialState) {
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=126214
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
+        state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
+        state also tracks the prerender state - so split this out and handle it separately (a change
+        we should make in WebCore, too).
+
+        Removing the redundancy also removes the ability from the API to set a fake visibility state
+        (IsVisible tracks the actual visibility of the view). Through private API
+        (WKPageSetVisibilityState) a client could previously request the view be reported as hidden or
+        visible, but this didn't really work - the override was not enforced and the API may reset the
+        state at an arbitrary point. The mechanism is only used by testing code, which instead should
+        actually update the view visibility (this tests more of the actual visibility mechanisms used
+        by the browser). The one aspect of the API relied on by existing clients is the ability to
+        initialize a hidden view as prerender - continue to support this specific functionality via
+        WKPageSetVisibilityState, to maintain backwards compatibility.
+
+        - WebKit2 - remove internal state that tracks page visibility separately from the view state
+        visibility. For backwards compatibility continue to support the WKPageSetVisibilityState API,
+        but only to initialize the state to prerender.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetVisibilityState):
+            - only support initializing the visibility state to prerender.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+            - remove m_visibilityState
+        (WebKit::WebPageProxy::initializeWebPage):
+            - no need to send initial visibility state (this is sent as a part of the creation parameters).
+        (WebKit::WebPageProxy::viewStateDidChange):
+            - no need to send visibility state change (this is sent as a part of view state).
+        (WebKit::WebPageProxy::setVisibilityStatePrerender):
+            - setVisibilityState -&gt; setVisibilityStatePrerender.
+        * UIProcess/WebPageProxy.h:
+            - remove m_visibilityState, setVisibilityState -&gt; setVisibilityStatePrerender.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+            - added call to updateVisibilityState.
+        (WebKit::WebPage::setViewIsVisible):
+            - added call to updateVisibilityState.
+        (WebKit::WebPage::updateVisibilityState):
+            - previously setVisibilityState, updates the page visibility state according to the view state.
+        (WebKit::WebPage::setVisibilityStatePrerender):
+            - set visibility state to prerender.
+        * WebProcess/WebPage/WebPage.h:
+            - remove m_visibilityState, setVisibilityState -&gt; setVisibilityStatePrerender.
+        * WebProcess/WebPage/WebPage.messages.in:
+            - SetVisibilityState -&gt; SetVisibilityStatePrerender.
+
</ins><span class="cx"> 2013-12-27  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Unnecessary code is built into WebKitPluginProcess
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -410,9 +410,10 @@
</span><span class="cx">     toImpl(pageRef)-&gt;listenForLayoutMilestones(toLayoutMilestones(milestones));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WKPageSetVisibilityState(WKPageRef pageRef, WKPageVisibilityState state, bool isInitialState)
</del><ins>+void WKPageSetVisibilityState(WKPageRef pageRef, WKPageVisibilityState state, bool)
</ins><span class="cx"> {
</span><del>-    toImpl(pageRef)-&gt;setVisibilityState(toPageVisibilityState(state), isInitialState);
</del><ins>+    if (state == kWKPageVisibilityStatePrerender)
+        toImpl(pageRef)-&gt;setVisibilityStatePrerender();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WKPageHasHorizontalScrollbar(WKPageRef pageRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -307,19 +307,12 @@
</span><span class="cx">     , m_clipsToExposedRect(false)
</span><span class="cx">     , m_lastSentClipsToExposedRect(false)
</span><span class="cx"> #endif
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    , m_visibilityState(PageVisibilityStateVisible)
-#endif
</del><span class="cx">     , m_scrollPinningBehavior(DoNotPin)
</span><span class="cx"> {
</span><span class="cx">     updateViewState();
</span><span class="cx"> 
</span><span class="cx">     platformInitialize();
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    if (!isViewVisible())
-        m_visibilityState = PageVisibilityStateHidden;
-#endif
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     webPageProxyCounter.increment();
</span><span class="cx"> #endif
</span><span class="lines">@@ -517,12 +510,6 @@
</span><span class="cx">     initializeCreationParameters();
</span><span class="cx">     process().send(Messages::WebProcess::CreateWebPage(m_pageID, m_creationParameters), 0);
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    send(Messages::WebPage::SetVisibilityState(m_visibilityState, /* isInitialState */ true));
-#elif ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
-    send(Messages::WebPage::SetVisibilityState(isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden, /* isInitialState */ true));
-#endif
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     send(Messages::WebPage::SetSmartInsertDeleteEnabled(m_isSmartInsertDeleteEnabled));
</span><span class="cx"> #endif
</span><span class="lines">@@ -977,14 +964,6 @@
</span><span class="cx">             // stop the unresponsiveness timer here.
</span><span class="cx">             m_process-&gt;responsivenessTimer()-&gt;stop();
</span><span class="cx">         }
</span><del>-
-#if ENABLE(PAGE_VISIBILITY_API)
-        m_visibilityState = isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden;
-        m_process-&gt;send(Messages::WebPage::SetVisibilityState(m_visibilityState, false), m_pageID);
-#elif ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
-        PageVisibilityState visibilityState = isViewVisible() ? PageVisibilityStateVisible : PageVisibilityStateHidden;
-        m_process-&gt;send(Messages::WebPage::SetVisibilityState(visibilityState, false), m_pageID);
-#endif
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR_POPOVER)
</span><span class="lines">@@ -1679,20 +1658,11 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::ListenForLayoutMilestones(milestones), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setVisibilityState(WebCore::PageVisibilityState visibilityState, bool isInitialState)
</del><ins>+void WebPageProxy::setVisibilityStatePrerender()
</ins><span class="cx"> {
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return;
</span><del>-
-#if ENABLE(PAGE_VISIBILITY_API)
-    if (visibilityState != m_visibilityState || isInitialState) {
-        m_visibilityState = visibilityState;
-        m_process-&gt;send(Messages::WebPage::SetVisibilityState(visibilityState, isInitialState), m_pageID);
-    }
-#else
-    UNUSED_PARAM(visibilityState);
-    UNUSED_PARAM(isInitialState);
-#endif
</del><ins>+    m_process-&gt;send(Messages::WebPage::SetVisibilityStatePrerender(), m_pageID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setSuppressScrollbarAnimations(bool suppressAnimations)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -561,7 +561,7 @@
</span><span class="cx"> 
</span><span class="cx">     void listenForLayoutMilestones(WebCore::LayoutMilestones);
</span><span class="cx"> 
</span><del>-    void setVisibilityState(WebCore::PageVisibilityState, bool isInitialState);
</del><ins>+    void setVisibilityStatePrerender();
</ins><span class="cx">     void didUpdateViewState() { m_waitingForDidUpdateViewState = false; }
</span><span class="cx"> 
</span><span class="cx">     bool hasHorizontalScrollbar() const { return m_mainFrameHasHorizontalScrollbar; }
</span><span class="lines">@@ -1364,10 +1364,6 @@
</span><span class="cx">     bool m_lastSentClipsToExposedRect;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    WebCore::PageVisibilityState m_visibilityState;
-#endif
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     HashMap&lt;String, String&gt; m_temporaryPDFFiles;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -276,9 +276,6 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     , m_shouldReturnWordAtSelection(false)
</span><span class="cx"> #endif
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    , m_visibilityState(WebCore::PageVisibilityStateVisible)
-#endif
</del><span class="cx">     , m_inspectorClient(0)
</span><span class="cx">     , m_backgroundColor(Color::white)
</span><span class="cx">     , m_maximumRenderingSuppressionToken(0)
</span><span class="lines">@@ -426,6 +423,8 @@
</span><span class="cx">     if (m_useThreadedScrolling)
</span><span class="cx">         WebProcess::shared().eventDispatcher().addScrollingTreeForPage(this);
</span><span class="cx"> #endif
</span><ins>+
+    updateVisibilityState(true);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebPage::~WebPage()
</span><span class="lines">@@ -1934,6 +1933,8 @@
</span><span class="cx">             m_page-&gt;resumeAnimatingImages();
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+
+    updateVisibilityState();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::setDrawsBackground(bool drawsBackground)
</span><span class="lines">@@ -3705,41 +3706,50 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
-void WebPage::setVisibilityState(uint32_t visibilityState, bool isInitialState)
</del><ins>+void WebPage::updateVisibilityState(bool isInitialState)
</ins><span class="cx"> {
</span><ins>+    bool isVisible = m_viewState &amp; ViewState::IsVisible;
</ins><span class="cx">     if (!m_page)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebCore::PageVisibilityState state = static_cast&lt;WebCore::PageVisibilityState&gt;(visibilityState);
-
</del><span class="cx"> #if ENABLE(PAGE_VISIBILITY_API)
</span><del>-    if (m_visibilityState == state)
-        return;
</del><span class="cx"> 
</span><span class="cx">     FrameView* view = m_page-&gt;mainFrame().view();
</span><span class="cx"> 
</span><del>-    if (state == WebCore::PageVisibilityStateVisible) {
</del><ins>+    if (isVisible) {
</ins><span class="cx">         m_page-&gt;didMoveOnscreen();
</span><span class="cx">         if (view)
</span><span class="cx">             view-&gt;show();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    PageVisibilityState state = isVisible ? PageVisibilityStateVisible : PageVisibilityStateHidden;
</ins><span class="cx">     m_page-&gt;setVisibilityState(state, isInitialState);
</span><del>-    m_visibilityState = state;
</del><span class="cx"> 
</span><del>-    if (state == WebCore::PageVisibilityStateHidden) {
</del><ins>+    if (!isVisible) {
</ins><span class="cx">         m_page-&gt;willMoveOffscreen();
</span><span class="cx">         if (view)
</span><span class="cx">             view-&gt;hide();
</span><span class="cx">     }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-#if ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING) &amp;&amp; !ENABLE(PAGE_VISIBILITY_API)
</del><ins>+#elif ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+
+    PageVisibilityState state = isVisible ? PageVisibilityStateVisible : PageVisibilityStateHidden;
</ins><span class="cx">     m_page-&gt;setVisibilityState(state, isInitialState);
</span><ins>+
+#else
+    UNUSED_PARAM(isVisible);
+    UNUSED_PARAM(isInitialState);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><ins>+
+void WebPage::setVisibilityStatePrerender()
+{
+#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
+    if (!m_page)
+        return;
+    m_page-&gt;setVisibilityState(PageVisibilityStatePrerender, true);
</ins><span class="cx"> #endif
</span><ins>+}
</ins><span class="cx"> 
</span><span class="cx"> void WebPage::setThrottled(bool isThrottled)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -614,9 +614,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool willGoToBackForwardItemCallbackEnabled() const { return m_willGoToBackForwardItemCallbackEnabled; }
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
-    void setVisibilityState(uint32_t /* WebCore::PageVisibilityState */, bool isInitialState);
-#endif
</del><ins>+    void setVisibilityStatePrerender();
+    void updateVisibilityState(bool isInitialState = false);
</ins><span class="cx">     void setThrottled(bool isThrottled);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -1039,9 +1038,6 @@
</span><span class="cx">     bool m_shouldReturnWordAtSelection;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API)
-    WebCore::PageVisibilityState m_visibilityState;
-#endif
</del><span class="cx">     WebInspectorClient* m_inspectorClient;
</span><span class="cx"> 
</span><span class="cx">     WebCore::Color m_backgroundColor;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -305,9 +305,7 @@
</span><span class="cx">     HandleAlternativeTextUIResult(String result)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(PAGE_VISIBILITY_API) || ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING)
-    SetVisibilityState(uint32_t visibilityState, bool isInitialState)
-#endif
</del><ins>+    SetVisibilityStatePrerender()
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     DidFinishScrolling(WebCore::FloatPoint contentOffset);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/ChangeLog        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2013-12-27  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Merge PageVisibilityState &amp; ViewState::IsVisible in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=126214
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebKit2 redundantly tracks the visibility of the view through two mechanisms - the visibility
+        state, and the view state. Remove visibility state from the WebKit2 layer. The visibility
+        state also tracks the prerender state - so split this out and handle it separately (a change
+        we should make in WebCore, too).
+
+        Tools - WebKit2 no longer (poorly) supports a fake visibility state, so to test the page
+        visibility mechanisms we should actually be changing characteristics of the view that will
+        be detected by WebKit2 as a visibility change. This affects three things:
+            1) On setVisibilityState WebKitTestRunner must actually change visibility of the view.
+            2) The 'PageVisibilityState' test in the API tests is useless (as evidenced by the fact
+               that page visibility has been broken in WebKit2 for a couple of months, and didn't
+               catch this fact). Removed in favour of:
+            3) 'PageVisibilityStateWithWindowChanges' - this is the good stuff. This actually tests
+               the visibility mechanism. Beef this test up by adding coverage for: a) the prerender
+            state, b) document.hidden, and c) too many state change notifications (it already looks
+            for too few).
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp: Removed.
+            - Removed PageVisibilityState - this test was ineffective, API no longer supports this
+              test, and behaviour is covered by PageVisibilityStateWithWindowChanges.
+        * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
+        (-[PageVisibilityStateDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]):
+        (runJavaScriptAlert):
+            - Add checking for too many calls to the alert.
+        (TestWebKitAPI::PageVisibilityStateWithWindowChanges::setPrerender):
+            - Added methods to set visibility to prerender.
+        (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
+            - Added checking of 'document.hidden'.
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::setVisibilityState):
+        * WebKitTestRunner/TestController.h:
+        * WebKitTestRunner/efl/TestControllerEfl.cpp:
+        (WTR::TestController::setHidden):
+        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+        (WTR::TestController::setHidden):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::setHidden):
+            - Add setHidden method; call this from setVisibilityState.
+
</ins><span class="cx"> 2013-12-27  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Display EWS status on bot watcher's dashboard
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/GNUmakefile.am (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/GNUmakefile.am        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/TestWebKitAPI/GNUmakefile.am        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -281,7 +281,6 @@
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp \
</span><del>-        Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp \
</del><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp \
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/TestWebKitAPI/PlatformEfl.cmake        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -83,7 +83,6 @@
</span><span class="cx">     NewFirstVisuallyNonEmptyLayoutForImages
</span><span class="cx">     PageLoadBasic
</span><span class="cx">     PageLoadDidChangeLocationWithinPageForFrame
</span><del>-    PageVisibilityState
</del><span class="cx">     ParentFrame
</span><span class="cx">     PreventEmptyUserAgent
</span><span class="cx">     PrivateBrowsingPushStateNoHistoryCallback
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -140,7 +140,6 @@
</span><span class="cx">                 9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; };
</span><span class="cx">                 9B4F8FA4159D52B1002D9F94 /* HTMLCollectionNamedItem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */; };
</span><span class="cx">                 9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */; };
</span><del>-                A51B650916ADF9B1007AA5D9 /* PageVisibilityState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A51B650816ADF9B1007AA5D9 /* PageVisibilityState.cpp */; };
</del><span class="cx">                 A57A34F016AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm in Sources */ = {isa = PBXBuildFile; fileRef = A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */; };
</span><span class="cx">                 A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */; };
</span><span class="cx">                 A5E2027315B2181900C13E14 /* WindowlessWebViewWithMedia.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */; };
</span><span class="lines">@@ -468,7 +467,6 @@
</span><span class="cx">                 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLFormCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLCollectionNamedItem.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLCollectionNamedItem.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                A51B650816ADF9B1007AA5D9 /* PageVisibilityState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageVisibilityState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 A57A34EF16AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageVisibilityStateWithWindowChanges.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A57A34F116AF69E200C2501F /* PageVisibilityStateWithWindowChanges.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = PageVisibilityStateWithWindowChanges.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = WindowlessWebViewWithMedia.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -791,7 +789,6 @@
</span><span class="cx">                                 93F7E86E14DC8E5B00C84A99 /* NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp */,
</span><span class="cx">                                 BC909779125571AB00083756 /* PageLoadBasic.cpp */,
</span><span class="cx">                                 BC2D004812A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp */,
</span><del>-                                A51B650816ADF9B1007AA5D9 /* PageVisibilityState.cpp */,
</del><span class="cx">                                 52E5CE4514D21E9D003B2BD8 /* ParentFrame.cpp */,
</span><span class="cx">                                 52E5CE4814D21EAB003B2BD8 /* ParentFrame_Bundle.cpp */,
</span><span class="cx">                                 C54237EE16B8955800E638FC /* PasteboardNotifications.mm */,
</span><span class="lines">@@ -1220,7 +1217,6 @@
</span><span class="cx">                                 BC2D004912A9FDFA00E732A3 /* PageLoadDidChangeLocationWithinPageForFrame.cpp in Sources */,
</span><span class="cx">                                 9331407C17B4419000F083B1 /* DidNotHandleKeyDown.cpp in Sources */,
</span><span class="cx">                                 26F52EAB182872600023D412 /* Geolocation.cpp in Sources */,
</span><del>-                                A51B650916ADF9B1007AA5D9 /* PageVisibilityState.cpp in Sources */,
</del><span class="cx">                                 A57A34F016AF677200C2501F /* PageVisibilityStateWithWindowChanges.mm in Sources */,
</span><span class="cx">                                 52E5CE4614D21E9D003B2BD8 /* ParentFrame.cpp in Sources */,
</span><span class="cx">                                 C54237F016B8955800E638FC /* PasteboardNotifications.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2PageVisibilityStatecpp"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1,102 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;PlatformUtilities.h&quot;
-#include &quot;PlatformWebView.h&quot;
-#include &quot;Test.h&quot;
-#include &lt;JavaScriptCore/JSContextRef.h&gt;
-#include &lt;WebKit2/WKRetainPtr.h&gt;
-#include &lt;WebKit2/WKSerializedScriptValue.h&gt;
-
-namespace TestWebKitAPI {
-
-static bool testDone;
-
-static void didRunStep1StateChangeVisibleToHidden(WKSerializedScriptValueRef, WKErrorRef, void*);
-static void didRunStep2StateChangeHiddenToPrerender(WKSerializedScriptValueRef, WKErrorRef, void*);
-static void didRunStep3StateChangePrerenderToUnloaded(WKSerializedScriptValueRef, WKErrorRef, void*);
-
-static void setPageVisibilityStateWithEvalContinuation(PlatformWebView* webView, WKPageVisibilityState visibilityState, WKPageRunJavaScriptFunction callback)
-{
-    WKPageSetVisibilityState(webView-&gt;page(), visibilityState, false);
-    WKRetainPtr&lt;WKStringRef&gt; javaScriptString(AdoptWK, WKStringCreateWithUTF8CString(&quot;document.visibilityState&quot;));
-    WKPageRunJavaScriptInMainFrame(webView-&gt;page(), javaScriptString.get(), static_cast&lt;void*&gt;(webView), callback);
-}
-
-static void assertSerializedScriptValueIsStringValue(WKSerializedScriptValueRef serializedValue, WKErrorRef error, const char *expected)
-{
-    EXPECT_NULL(error);
-    EXPECT_NOT_NULL(serializedValue);
-    if (error || !serializedValue)
-        return;
-
-    JSGlobalContextRef scriptContext = JSGlobalContextCreate(0);
-    JSValueRef scriptValue = WKSerializedScriptValueDeserialize(serializedValue, scriptContext, 0);
-    EXPECT_TRUE(JSValueIsString(scriptContext, scriptValue));
-    if (!JSValueIsString(scriptContext, scriptValue)) {
-        JSGlobalContextRelease(scriptContext);
-        return;
-    }
-
-    JSStringRef expectedString = JSStringCreateWithUTF8CString(expected);
-    JSStringRef scriptString = JSValueToStringCopy(scriptContext, scriptValue, 0);
-    EXPECT_TRUE(JSStringIsEqual(scriptString, expectedString));
-
-    JSStringRelease(scriptString);
-    JSStringRelease(expectedString);
-    JSGlobalContextRelease(scriptContext);
-}
-
-static void didRunStep1StateChangeVisibleToHidden(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context)
-{
-    assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, &quot;visible&quot;);
-    setPageVisibilityStateWithEvalContinuation(static_cast&lt;PlatformWebView*&gt;(context), kWKPageVisibilityStateHidden, didRunStep2StateChangeHiddenToPrerender);
-}
-
-static void didRunStep2StateChangeHiddenToPrerender(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context)
-{
-    assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, &quot;hidden&quot;);
-    setPageVisibilityStateWithEvalContinuation(static_cast&lt;PlatformWebView*&gt;(context), kWKPageVisibilityStatePrerender, didRunStep3StateChangePrerenderToUnloaded);
-}
-
-static void didRunStep3StateChangePrerenderToUnloaded(WKSerializedScriptValueRef resultSerializedScriptValue, WKErrorRef error, void* context)
-{
-    assertSerializedScriptValueIsStringValue(resultSerializedScriptValue, error, &quot;prerender&quot;);
-    testDone = true;
-}
-
-TEST(WebKit2, PageVisibilityState)
-{
-    WKRetainPtr&lt;WKContextRef&gt; context(AdoptWK, WKContextCreate());
-
-    // Pass the PlatformWebView webView on as the context of the evals, so we can continue to eval on it.
-    PlatformWebView webView(context.get());
-    setPageVisibilityStateWithEvalContinuation(&amp;webView, kWKPageVisibilityStateVisible, didRunStep1StateChangeVisibleToHidden);
-
-    Util::run(&amp;testDone);
-}
-
-} // namespace TestWebKitAPI
</del></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsmacPageVisibilityStateWithWindowChangesmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -27,11 +27,12 @@
</span><span class="cx"> #import &quot;JavaScriptTest.h&quot;
</span><span class="cx"> #import &quot;Test.h&quot;
</span><span class="cx"> #import &quot;WebKitAgnosticTest.h&quot;
</span><del>-#import &lt;WebKit/WebView.h&gt;
</del><ins>+#import &lt;WebKit/WebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit2/WKViewPrivate.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> 
</span><del>-static bool didGetPageSignalToContinue;
</del><ins>+static bool isWaitingForPageSignalToContinue = false;
+static bool didGetPageSignalToContinue = false;
</ins><span class="cx"> 
</span><span class="cx"> // WebKit1 WebUIDelegate
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +43,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
</span><span class="cx"> {
</span><ins>+    EXPECT_TRUE(isWaitingForPageSignalToContinue);
+    isWaitingForPageSignalToContinue = false;
</ins><span class="cx">     didGetPageSignalToContinue = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -51,6 +54,8 @@
</span><span class="cx"> 
</span><span class="cx"> static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
</span><span class="cx"> {
</span><ins>+    EXPECT_TRUE(isWaitingForPageSignalToContinue);
+    isWaitingForPageSignalToContinue = false;
</ins><span class="cx">     didGetPageSignalToContinue = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -72,6 +77,8 @@
</span><span class="cx">     virtual void initializeView(WKView *) OVERRIDE;
</span><span class="cx">     virtual void teardownView(WebView *) OVERRIDE;
</span><span class="cx">     virtual void teardownView(WKView *) OVERRIDE;
</span><ins>+    virtual void setPrerender(WebView *);
+    virtual void setPrerender(WKView *);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void PageVisibilityStateWithWindowChanges::initializeView(WebView *webView)
</span><span class="lines">@@ -87,6 +94,11 @@
</span><span class="cx">     [uiDelegate release];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageVisibilityStateWithWindowChanges::setPrerender(WebView *webView)
+{
+    [webView _setVisibilityState:WebPageVisibilityStatePrerender isInitialState:YES];
+}
+
</ins><span class="cx"> void PageVisibilityStateWithWindowChanges::initializeView(WKView *wkView)
</span><span class="cx"> {
</span><span class="cx">     WKPageUIClientV0 uiClient;
</span><span class="lines">@@ -103,6 +115,12 @@
</span><span class="cx">     // We do not need to teardown the WKPageUIClient.
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageVisibilityStateWithWindowChanges::setPrerender(WKView *wkView)
+{
+    WKPageSetVisibilityState(wkView.pageRef, kWKPageVisibilityStatePrerender, true);
+}
+
+
</ins><span class="cx"> template &lt;typename View&gt;
</span><span class="cx"> void PageVisibilityStateWithWindowChanges::runTest(View view)
</span><span class="cx"> {
</span><span class="lines">@@ -110,35 +128,49 @@
</span><span class="cx">     EXPECT_NULL([view window]);
</span><span class="cx">     EXPECT_NULL([view superview]);
</span><span class="cx">     EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;hidden&quot;);
</span><ins>+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;true&quot;);
</ins><span class="cx"> 
</span><del>-    // Add it to a non-visible window. PageVisibility should still be &quot;hidden&quot;.
</del><ins>+    // Mark the page as being a &quot;prerender&quot;.
+    setPrerender(view);
+    EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;prerender&quot;);
+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;true&quot;);
+
+    // Add it to a non-visible window. PageVisibility should still be &quot;prerender&quot;.
</ins><span class="cx">     RetainPtr&lt;NSWindow&gt; window = adoptNS([[NSWindow alloc] initWithContentRect:view.frame styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
</span><span class="cx">     [window.get().contentView addSubview:view];
</span><span class="cx">     EXPECT_NOT_NULL([view window]);
</span><span class="cx">     EXPECT_NOT_NULL([view superview]);
</span><span class="cx">     EXPECT_FALSE([window.get() isVisible]);
</span><del>-    EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;hidden&quot;);
</del><ins>+    EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;prerender&quot;);
+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;true&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // Make the window visible. PageVisibility should become &quot;visible&quot;.
</span><del>-    didGetPageSignalToContinue = false;    
</del><ins>+    isWaitingForPageSignalToContinue = true;
+    didGetPageSignalToContinue = false;
</ins><span class="cx">     [window.get() makeKeyAndOrderFront:nil];
</span><span class="cx">     EXPECT_TRUE([window.get() isVisible]);
</span><span class="cx">     Util::run(&amp;didGetPageSignalToContinue);
</span><span class="cx">     EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;visible&quot;);
</span><ins>+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;false&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // Minimize the window. PageVisibility should become &quot;hidden&quot;.
</span><ins>+    isWaitingForPageSignalToContinue = true;
</ins><span class="cx">     didGetPageSignalToContinue = false;
</span><span class="cx">     [window.get() miniaturize:nil];
</span><span class="cx">     Util::run(&amp;didGetPageSignalToContinue);
</span><span class="cx">     EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;hidden&quot;);
</span><ins>+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;true&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // Deminimize the window. PageVisibility should become &quot;visible&quot;.
</span><ins>+    isWaitingForPageSignalToContinue = true;
</ins><span class="cx">     didGetPageSignalToContinue = false;
</span><span class="cx">     [window.get() deminiaturize:nil];
</span><span class="cx">     Util::run(&amp;didGetPageSignalToContinue);
</span><span class="cx">     EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;visible&quot;);
</span><ins>+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;false&quot;);
</ins><span class="cx"> 
</span><span class="cx">     // Remove the WebView from its superview. PageVisibility should become &quot;hidden&quot;.
</span><ins>+    isWaitingForPageSignalToContinue = true;
</ins><span class="cx">     didGetPageSignalToContinue = false;
</span><span class="cx">     [view removeFromSuperview];
</span><span class="cx">     EXPECT_NULL([view window]);
</span><span class="lines">@@ -146,6 +178,7 @@
</span><span class="cx">     EXPECT_TRUE([window.get() isVisible]);
</span><span class="cx">     Util::run(&amp;didGetPageSignalToContinue);
</span><span class="cx">     EXPECT_JS_EQ(view, &quot;document.visibilityState&quot;, &quot;hidden&quot;);
</span><ins>+    EXPECT_JS_EQ(view, &quot;document.hidden&quot;, &quot;true&quot;);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> TEST_F(PageVisibilityStateWithWindowChanges, WebKit)
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -1167,6 +1167,7 @@
</span><span class="cx"> 
</span><span class="cx"> void TestController::setVisibilityState(WKPageVisibilityState visibilityState, bool isInitialState)
</span><span class="cx"> {
</span><ins>+    setHidden(visibilityState != kWKPageVisibilityStateVisible);
</ins><span class="cx">     WKPageSetVisibilityState(m_mainWebView-&gt;page(), visibilityState, isInitialState);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestController.h (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/TestController.h        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/WebKitTestRunner/TestController.h        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -164,6 +164,8 @@
</span><span class="cx">     static void runModal(WKPageRef, const void* clientInfo);
</span><span class="cx">     static void runModal(PlatformWebView*);
</span><span class="cx"> 
</span><ins>+    void setHidden(bool);
+
</ins><span class="cx">     static const char* libraryPathForTesting();
</span><span class="cx">     static const char* platformLibraryPathForTesting();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnereflTestControllerEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/WebKitTestRunner/efl/TestControllerEfl.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -101,6 +101,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestController::setHidden(bool)
+{
+    // FIXME: Need to implement this to test visibilityState.
+}
+
</ins><span class="cx"> void TestController::runModal(PlatformWebView*)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Need to implement this to test showModalDialog.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnergtkTestControllerGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -102,6 +102,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestController::setHidden(bool)
+{
+    // FIXME: Need to implement this to test visibilityState.
+}
+
</ins><span class="cx"> void TestController::runModal(PlatformWebView*)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Need to implement this to test showModalDialog.
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacTestControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (161104 => 161105)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2013-12-27 18:39:04 UTC (rev 161104)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2013-12-27 19:46:00 UTC (rev 161105)
</span><span class="lines">@@ -78,6 +78,18 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void TestController::setHidden(bool hidden)
+{
+    NSWindow *window = [mainWebView()-&gt;platformView() window];
+    if (!window)
+        return;
+
+    if (hidden)
+        [window orderOut:nil];
+    else
+        [window makeKeyAndOrderFront:nil];
+}
+
</ins><span class="cx"> void TestController::runModal(PlatformWebView* view)
</span><span class="cx"> {
</span><span class="cx">     NSWindow *window = [view-&gt;platformView() window];
</span></span></pre>
</div>
</div>

</body>
</html>