<!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>[178300] 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/178300">178300</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2015-01-12 15:14:24 -0800 (Mon, 12 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Geolocation objects shouldn't prevent page caching.
&lt;https://webkit.org/b/140369&gt;

Reviewed by Joseph Pecoraro.

Source/WebCore:

Enable the code for suspend/resume of Geolocation objects on all platforms
instead of just iOS. This allows pages using geolocation to use page cache
instead of reloading on back/forward navigation.

Test: fast/history/page-cache-geolocation.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::Geolocation):
(WebCore::Geolocation::resetAllGeolocationPermission):
(WebCore::Geolocation::stop):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::positionChanged):
(WebCore::Geolocation::setError):
* Modules/geolocation/Geolocation.h:

LayoutTests:

Take the existing test for this and make it not-specific-to-iOS.
Also remove a test whose only purpose was confirming that we don't cache these pages.

* fast/dom/Geolocation/no-page-cache-expected.txt: Removed.
* fast/dom/Geolocation/no-page-cache.html: Removed.
* fast/dom/Geolocation/script-tests/no-page-cache.js: Removed.
* fast/history/page-cache-geolocation-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt.
* fast/history/page-cache-geolocation.html: Renamed from LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js.
* fast/history/resources/page-cache-helper.html: Added.
* platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt: Removed.
* platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html: Removed.
* platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js: Removed.
* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/ios/fast/history/page-cache-geolocation.html: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationcpp">trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationh">trunk/Source/WebCore/Modules/geolocation/Geolocation.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasthistorypagecachegeolocationexpectedtxt">trunk/LayoutTests/fast/history/page-cache-geolocation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasthistorypagecachegeolocationhtml">trunk/LayoutTests/fast/history/page-cache-geolocation.html</a></li>
<li><a href="#trunkLayoutTestsfasthistoryresourcespagecachehelperhtml">trunk/LayoutTests/fast/history/resources/page-cache-helper.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomGeolocationnopagecacheexpectedtxt">trunk/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomGeolocationnopagecachehtml">trunk/LayoutTests/fast/dom/Geolocation/no-page-cache.html</a></li>
<li><a href="#trunkLayoutTestsfastdomGeolocationscripttestsnopagecachejs">trunk/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js</a></li>
<li><a href="#trunkLayoutTestsplatformiossimdeprecatediphonefasthistorypagecachegeolocationexpectedtxt">trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimdeprecatediphonefasthistorypagecachegeolocationhtml">trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimdeprecatediphonefasthistoryscripttestspagecachegeolocationjs">trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatoriosfasthistorypagecachegeolocationexpectedtxt">trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatoriosfasthistorypagecachegeolocationhtml">trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatoriosfasthistoryscripttestspagecachegeolocationjs">trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/ChangeLog        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-01-12  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Geolocation objects shouldn't prevent page caching.
+        &lt;https://webkit.org/b/140369&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Take the existing test for this and make it not-specific-to-iOS.
+        Also remove a test whose only purpose was confirming that we don't cache these pages.
+
+        * fast/dom/Geolocation/no-page-cache-expected.txt: Removed.
+        * fast/dom/Geolocation/no-page-cache.html: Removed.
+        * fast/dom/Geolocation/script-tests/no-page-cache.js: Removed.
+        * fast/history/page-cache-geolocation-expected.txt: Renamed from LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt.
+        * fast/history/page-cache-geolocation.html: Renamed from LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js.
+        * fast/history/resources/page-cache-helper.html: Added.
+        * platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt: Removed.
+        * platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html: Removed.
+        * platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js: Removed.
+        * platform/ios-simulator/TestExpectations:
+        * platform/ios-simulator/ios/fast/history/page-cache-geolocation.html: Removed.
+
</ins><span class="cx"> 2015-01-12  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make fast/css/first-letter-skip-out-of-flow.html a ref-test
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomGeolocationnopagecacheexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,16 +0,0 @@
</span><del>-Tests that pages that use Geolocation are not put in the page cache.
-
-Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-Main page opening resources/cached-page-1.html
-resources/cached-page-1.html fired, count = 1
-resources/cached-page-1.html about to navigate to resources/cached-page-2.html
-resources/cached-page-2.html about to go back to resources/cached-page-1.html
-resources/cached-page-1.html fired, count = 2
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomGeolocationnopagecachehtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/Geolocation/no-page-cache.html (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Geolocation/no-page-cache.html        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/fast/dom/Geolocation/no-page-cache.html        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script src=&quot;script-tests/no-page-cache.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsfastdomGeolocationscripttestsnopagecachejs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,23 +0,0 @@
</span><del>-description(&quot;Tests that pages that use Geolocation are not put in the page cache.&lt;br&gt;&lt;br&gt;Currently, Geolocation does not work with the page cache so pages that use Geolocation are explicitly prevented from entering the cache. This test checks for accidental enabling of the page Cache for Geolocation. See https://bugs.webkit.org/show_bug.cgi?id=43956 for details.&quot;);
-
-if (window.testRunner) {
-    testRunner.waitUntilDone();
-    testRunner.setCanOpenWindows();
-    testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
-} else
-    debug('This test can not be run without the testRunner');
-
-var pageOneOnloadCount = 0;
-function reportPageOneOnload() {
-    ++pageOneOnloadCount;
-    debug('resources/cached-page-1.html fired, count = ' + pageOneOnloadCount);
-    if (pageOneOnloadCount == 2) {
-        finishJSTest();
-    }
-    return pageOneOnloadCount;
-}
-
-debug(&quot;Main page opening resources/cached-page-1.html&quot;);
-window.open(&quot;resources/cached-page-1.html&quot;);
-
-window.jsTestIsAsync = true;
</del></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachegeolocationexpectedtxtfromrev178299trunkLayoutTestsplatformiossimulatoriosfasthistorypagecachegeolocationexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/history/page-cache-geolocation-expected.txt (from rev 178299, trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt) (0 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-geolocation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-geolocation-expected.txt        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests that a page that makes use of simple geolocation can use the page cache.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+[object Geolocation]
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS - Page did enter and was restored from the page cache
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistorypagecachegeolocationhtmlfromrev178299trunkLayoutTestsplatformiossimulatoriosfasthistoryscripttestspagecachegeolocationjs"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/history/page-cache-geolocation.html (from rev 178299, trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js) (0 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/page-cache-geolocation.html                                (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-geolocation.html        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+description('Tests that a page that makes use of simple geolocation can use the page cache.');
+
+window.addEventListener(&quot;pageshow&quot;, function(event) {
+    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
+    if (event.persisted) {
+        debug(&quot;PASS - Page did enter and was restored from the page cache&quot;);
+        finishJSTest();
+        window.testRunner.notifyDone();
+    }
+}, false);
+
+window.addEventListener(&quot;pagehide&quot;, function(event) {
+    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
+    if (!event.persisted) {
+        debug(&quot;FAIL - Page did not enter the page cache.&quot;);
+        finishJSTest();
+        window.testRunner.notifyDone();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+
+    // Enable the PageCache and make this an async test.
+    if (window.testRunner) {
+        window.testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
+        window.testRunner.waitUntilDone();
+    }
+
+    // Access geolocation. It is enough to create the geolocation object.
+    debug(navigator.geolocation);
+
+    // Force a back navigation back to this page.
+    setTimeout(function() {
+        window.location.href = &quot;resources/page-cache-helper.html&quot;;
+    }, 0);
+
+}, false);
+
+var successfullyParsed = true;
+var jsTestIsAsync = true;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasthistoryresourcespagecachehelperhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/history/resources/page-cache-helper.html (0 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/history/resources/page-cache-helper.html                                (rev 0)
+++ trunk/LayoutTests/fast/history/resources/page-cache-helper.html        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+This page should go back. If a test outputs the contents of this
+page, then the test page failed to enter the page cache.
+&lt;script&gt;
+  window.addEventListener(&quot;load&quot;, function() {
+    setTimeout(function() {
+      history.back();
+    }, 0);
+  }, false);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimdeprecatediphonefasthistorypagecachegeolocationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-CONSOLE MESSAGE: line 1: TypeError: HTMLParagraphElement is not a function (evaluating 'description('Tests that a page that makes use of simple geolocation can use the page cache.')')
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {P} at (0,0) size 784x0
-      RenderBlock {DIV} at (0,0) size 784x0
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimdeprecatediphonefasthistorypagecachegeolocationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;link rel=&quot;stylesheet&quot; href=&quot;../../../../../fast/js/resources/js-test-style.css&quot;&gt;
-&lt;script src=&quot;../../../../../fast/js/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;script src=&quot;script-tests/page-cache-geolocation.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;../../../../../fast/js/resources/js-test-post-function.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimdeprecatediphonefasthistoryscripttestspagecachegeolocationjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-description('Tests that a page that makes use of simple geolocation can use the page cache.');
-
-window.addEventListener(&quot;pageshow&quot;, function(event) {
-    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
-    if (event.persisted) {
-        debug(&quot;PASS - Page did enter and was restored from the page cache&quot;);
-        finishJSTest();
-        window.testRunner.notifyDone();
-    }
-}, false);
-
-window.addEventListener(&quot;pagehide&quot;, function(event) {
-    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
-    if (!event.persisted) {
-        debug(&quot;FAIL - Page did not enter the page cache.&quot;);
-        finishJSTest();
-        window.testRunner.notifyDone();
-    }
-}, false);
-
-window.addEventListener('load', function() {
-
-    // Enable the PageCache and make this an async test.
-    if (window.testRunner) {
-        window.testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
-        window.testRunner.waitUntilDone();
-    }
-
-    // Access geolocation. It is enough to create the geolocation object.
-    debug(navigator.geolocation);
-
-    // Force a back navigation back to this page.
-    setTimeout(function() {
-        window.location.href = &quot;resources/page-cache-helper.html&quot;;
-    }, 0);
-
-}, false);
-
-var successfullyParsed = true;
-var jsTestIsAsync = true;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -2401,7 +2401,6 @@
</span><span class="cx"> fast/dom/DeviceOrientation/no-synchronous-events.html
</span><span class="cx"> fast/dom/DeviceOrientation/null-values.html
</span><span class="cx"> fast/dom/DeviceOrientation/updates.html
</span><del>-fast/dom/Geolocation/no-page-cache.html
</del><span class="cx"> fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
</span><span class="cx"> fast/dom/HTMLLinkElement/link-and-subresource-test.html
</span><span class="cx"> fast/dom/HTMLLinkElement/prefetch-onerror.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatoriosfasthistorypagecachegeolocationexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-Tests that a page that makes use of simple geolocation can use the page cache.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-[object Geolocation]
-pageshow - not from cache
-pagehide - entering cache
-pageshow - from cache
-PASS - Page did enter and was restored from the page cache
-
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatoriosfasthistorypagecachegeolocationhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation.html (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation.html        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation.html        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
-&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
-&lt;script src=&quot;script-tests/page-cache-geolocation.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatoriosfasthistoryscripttestspagecachegeolocationjs"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,40 +0,0 @@
</span><del>-description('Tests that a page that makes use of simple geolocation can use the page cache.');
-
-window.addEventListener(&quot;pageshow&quot;, function(event) {
-    debug(&quot;pageshow - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;from cache&quot;);
-    if (event.persisted) {
-        debug(&quot;PASS - Page did enter and was restored from the page cache&quot;);
-        finishJSTest();
-        window.testRunner.notifyDone();
-    }
-}, false);
-
-window.addEventListener(&quot;pagehide&quot;, function(event) {
-    debug(&quot;pagehide - &quot; + (event.persisted ? &quot;&quot; : &quot;not &quot;) + &quot;entering cache&quot;);
-    if (!event.persisted) {
-        debug(&quot;FAIL - Page did not enter the page cache.&quot;);
-        finishJSTest();
-        window.testRunner.notifyDone();
-    }
-}, false);
-
-window.addEventListener('load', function() {
-
-    // Enable the PageCache and make this an async test.
-    if (window.testRunner) {
-        window.testRunner.overridePreference(&quot;WebKitUsesPageCachePreferenceKey&quot;, 1);
-        window.testRunner.waitUntilDone();
-    }
-
-    // Access geolocation. It is enough to create the geolocation object.
-    debug(navigator.geolocation);
-
-    // Force a back navigation back to this page.
-    setTimeout(function() {
-        window.location.href = &quot;resources/page-cache-helper.html&quot;;
-    }, 0);
-
-}, false);
-
-var successfullyParsed = true;
-var jsTestIsAsync = true;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/Source/WebCore/ChangeLog        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-01-12  Andreas Kling  &lt;akling@apple.com&gt;
+
+        Geolocation objects shouldn't prevent page caching.
+        &lt;https://webkit.org/b/140369&gt;
+
+        Reviewed by Joseph Pecoraro.
+
+        Enable the code for suspend/resume of Geolocation objects on all platforms
+        instead of just iOS. This allows pages using geolocation to use page cache
+        instead of reloading on back/forward navigation.
+
+        Test: fast/history/page-cache-geolocation.html
+
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::Geolocation):
+        (WebCore::Geolocation::resetAllGeolocationPermission):
+        (WebCore::Geolocation::stop):
+        (WebCore::Geolocation::setIsAllowed):
+        (WebCore::Geolocation::positionChanged):
+        (WebCore::Geolocation::setError):
+        * Modules/geolocation/Geolocation.h:
+
</ins><span class="cx"> 2015-01-12  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Log navigation types using DiagnosticLoggingClient
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -235,11 +235,9 @@
</span><span class="cx"> Geolocation::Geolocation(ScriptExecutionContext* context)
</span><span class="cx">     : ActiveDOMObject(context)
</span><span class="cx">     , m_allowGeolocation(Unknown)
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     , m_isSuspended(false)
</span><span class="cx">     , m_hasChangedPosition(false)
</span><span class="cx">     , m_resumeTimer(*this, &amp;Geolocation::resumeTimerFired)
</span><del>-#endif
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -263,7 +261,6 @@
</span><span class="cx">     return document() ? document()-&gt;page() : nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
</del><span class="cx"> bool Geolocation::canSuspend() const
</span><span class="cx"> {
</span><span class="cx">     return !hasListeners();
</span><span class="lines">@@ -378,7 +375,6 @@
</span><span class="cx">     for (size_t i = 0; i &lt; watcherCopy.size(); ++i)
</span><span class="cx">         startRequest(watcherCopy[i].get());
</span><span class="cx"> }
</span><del>-#endif // PLATFORM(IOS)
</del><span class="cx"> 
</span><span class="cx"> void Geolocation::stop()
</span><span class="cx"> {
</span><span class="lines">@@ -389,10 +385,8 @@
</span><span class="cx">     m_allowGeolocation = Unknown;
</span><span class="cx">     cancelAllRequests();
</span><span class="cx">     stopUpdating();
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     m_hasChangedPosition = false;
</span><span class="cx">     m_errorWaitingForResume = nullptr;
</span><del>-#endif // PLATFORM(IOS)
</del><span class="cx">     m_pendingForPermissionNotifiers.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -555,10 +549,8 @@
</span><span class="cx">     // position.
</span><span class="cx">     m_allowGeolocation = allowed ? Yes : No;
</span><span class="cx">     
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     if (m_isSuspended)
</span><span class="cx">         return;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     // Permission request was made during the startRequest process
</span><span class="cx">     if (!m_pendingForPermissionNotifiers.isEmpty()) {
</span><span class="lines">@@ -572,10 +564,8 @@
</span><span class="cx">         error-&gt;setIsFatal(true);
</span><span class="cx">         handleError(error.get());
</span><span class="cx">         m_requestsAwaitingCachedPosition.clear();
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">         m_hasChangedPosition = false;
</span><span class="cx">         m_errorWaitingForResume = nullptr;
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -756,24 +746,20 @@
</span><span class="cx">     // Stop all currently running timers.
</span><span class="cx">     stopTimers();
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     if (m_isSuspended) {
</span><span class="cx">         m_hasChangedPosition = true;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-#endif
</del><span class="cx"> 
</span><span class="cx">     makeSuccessCallbacks();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Geolocation::setError(GeolocationError* error)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     if (m_isSuspended) {
</span><span class="cx">         m_errorWaitingForResume = createPositionError(error);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-#endif
</del><span class="cx">     RefPtr&lt;PositionError&gt; positionError = createPositionError(error);
</span><span class="cx">     handleError(positionError.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.h (178299 => 178300)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.h        2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.h        2015-01-12 23:14:24 UTC (rev 178300)
</span><span class="lines">@@ -54,12 +54,10 @@
</span><span class="cx">     static Ref&lt;Geolocation&gt; create(ScriptExecutionContext*);
</span><span class="cx">     WEBCORE_EXPORT ~Geolocation();
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     virtual bool canSuspend() const override;
</span><span class="cx">     virtual void suspend(ReasonForSuspension) override;
</span><span class="cx">     virtual void resume() override;
</span><span class="cx">     WEBCORE_EXPORT void resetAllGeolocationPermission();
</span><del>-#endif // PLATFORM(IOS)
</del><span class="cx">     Document* document() const;
</span><span class="cx">     WEBCORE_EXPORT Frame* frame() const;
</span><span class="cx"> 
</span><span class="lines">@@ -182,7 +180,6 @@
</span><span class="cx">         Yes,
</span><span class="cx">         No
</span><span class="cx">     } m_allowGeolocation;
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     bool m_isSuspended;
</span><span class="cx">     bool m_resetOnResume;
</span><span class="cx">     bool m_hasChangedPosition;
</span><span class="lines">@@ -190,7 +187,6 @@
</span><span class="cx"> 
</span><span class="cx">     void resumeTimerFired();
</span><span class="cx">     Timer m_resumeTimer;
</span><del>-#endif // PLATFORM(IOS)
</del><span class="cx"> 
</span><span class="cx">     GeoNotifierSet m_requestsAwaitingCachedPosition;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>