Diff
Modified: trunk/LayoutTests/ChangeLog (178299 => 178300)
--- trunk/LayoutTests/ChangeLog 2015-01-12 22:40:29 UTC (rev 178299)
+++ trunk/LayoutTests/ChangeLog 2015-01-12 23:14:24 UTC (rev 178300)
@@ -1,3 +1,25 @@
+2015-01-12 Andreas Kling <akl...@apple.com>
+
+ Geolocation objects shouldn't prevent page caching.
+ <https://webkit.org/b/140369>
+
+ 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.
+
2015-01-12 Manuel Rego Casasnovas <r...@igalia.com>
Make fast/css/first-letter-skip-out-of-flow.html a ref-test
Deleted: trunk/LayoutTests/fast/dom/Geolocation/no-page-cache-expected.txt (178299 => 178300)
--- 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)
@@ -1,16 +0,0 @@
-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 "PASS" messages, followed by "TEST COMPLETE".
-
-
-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
-
Deleted: trunk/LayoutTests/fast/dom/Geolocation/no-page-cache.html (178299 => 178300)
--- 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)
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<script src=""
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/fast/dom/Geolocation/script-tests/no-page-cache.js (178299 => 178300)
--- 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)
@@ -1,23 +0,0 @@
-description("Tests that pages that use Geolocation are not put in the page cache.<br><br>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.");
-
-if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.setCanOpenWindows();
- testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 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("Main page opening resources/cached-page-1.html");
-window.open("resources/cached-page-1.html");
-
-window.jsTestIsAsync = true;
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)
--- 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)
@@ -0,0 +1,11 @@
+Tests that a page that makes use of simple geolocation can use the page cache.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+[object Geolocation]
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS - Page did enter and was restored from the page cache
+
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)
--- 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)
@@ -0,0 +1,52 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description('Tests that a page that makes use of simple geolocation can use the page cache.');
+
+window.addEventListener("pageshow", function(event) {
+ debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+ if (event.persisted) {
+ debug("PASS - Page did enter and was restored from the page cache");
+ finishJSTest();
+ window.testRunner.notifyDone();
+ }
+}, false);
+
+window.addEventListener("pagehide", function(event) {
+ debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+ if (!event.persisted) {
+ debug("FAIL - Page did not enter the page cache.");
+ finishJSTest();
+ window.testRunner.notifyDone();
+ }
+}, false);
+
+window.addEventListener('load', function() {
+
+ // Enable the PageCache and make this an async test.
+ if (window.testRunner) {
+ window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 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 = ""
+ }, 0);
+
+}, false);
+
+var successfullyParsed = true;
+var jsTestIsAsync = true;
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/fast/history/resources/page-cache-helper.html (0 => 178300)
--- 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)
@@ -0,0 +1,9 @@
+This page should go back. If a test outputs the contents of this
+page, then the test page failed to enter the page cache.
+<script>
+ window.addEventListener("load", function() {
+ setTimeout(function() {
+ history.back();
+ }, 0);
+ }, false);
+</script>
Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation-expected.txt (178299 => 178300)
--- 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)
@@ -1,8 +0,0 @@
-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
Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/page-cache-geolocation.html (178299 => 178300)
--- 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)
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<link rel="stylesheet" href=""
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/platform/ios-sim-deprecated/iphone/fast/history/script-tests/page-cache-geolocation.js (178299 => 178300)
--- 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)
@@ -1,40 +0,0 @@
-description('Tests that a page that makes use of simple geolocation can use the page cache.');
-
-window.addEventListener("pageshow", function(event) {
- debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
- if (event.persisted) {
- debug("PASS - Page did enter and was restored from the page cache");
- finishJSTest();
- window.testRunner.notifyDone();
- }
-}, false);
-
-window.addEventListener("pagehide", function(event) {
- debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
- if (!event.persisted) {
- debug("FAIL - Page did not enter the page cache.");
- finishJSTest();
- window.testRunner.notifyDone();
- }
-}, false);
-
-window.addEventListener('load', function() {
-
- // Enable the PageCache and make this an async test.
- if (window.testRunner) {
- window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 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 = ""
- }, 0);
-
-}, false);
-
-var successfullyParsed = true;
-var jsTestIsAsync = true;
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (178299 => 178300)
--- 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)
@@ -2401,7 +2401,6 @@
fast/dom/DeviceOrientation/no-synchronous-events.html
fast/dom/DeviceOrientation/null-values.html
fast/dom/DeviceOrientation/updates.html
-fast/dom/Geolocation/no-page-cache.html
fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent.html
fast/dom/HTMLLinkElement/link-and-subresource-test.html
fast/dom/HTMLLinkElement/prefetch-onerror.html
Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation-expected.txt (178299 => 178300)
--- 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)
@@ -1,11 +0,0 @@
-Tests that a page that makes use of simple geolocation can use the page cache.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-[object Geolocation]
-pageshow - not from cache
-pagehide - entering cache
-pageshow - from cache
-PASS - Page did enter and was restored from the page cache
-
Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/page-cache-geolocation.html (178299 => 178300)
--- 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)
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script src=""
-</body>
-</html>
Deleted: trunk/LayoutTests/platform/ios-simulator/ios/fast/history/script-tests/page-cache-geolocation.js (178299 => 178300)
--- 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)
@@ -1,40 +0,0 @@
-description('Tests that a page that makes use of simple geolocation can use the page cache.');
-
-window.addEventListener("pageshow", function(event) {
- debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
- if (event.persisted) {
- debug("PASS - Page did enter and was restored from the page cache");
- finishJSTest();
- window.testRunner.notifyDone();
- }
-}, false);
-
-window.addEventListener("pagehide", function(event) {
- debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
- if (!event.persisted) {
- debug("FAIL - Page did not enter the page cache.");
- finishJSTest();
- window.testRunner.notifyDone();
- }
-}, false);
-
-window.addEventListener('load', function() {
-
- // Enable the PageCache and make this an async test.
- if (window.testRunner) {
- window.testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 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 = ""
- }, 0);
-
-}, false);
-
-var successfullyParsed = true;
-var jsTestIsAsync = true;
Modified: trunk/Source/WebCore/ChangeLog (178299 => 178300)
--- 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)
@@ -1,3 +1,25 @@
+2015-01-12 Andreas Kling <akl...@apple.com>
+
+ Geolocation objects shouldn't prevent page caching.
+ <https://webkit.org/b/140369>
+
+ 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:
+
2015-01-12 Chris Dumez <cdu...@apple.com>
Log navigation types using DiagnosticLoggingClient
Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (178299 => 178300)
--- 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)
@@ -235,11 +235,9 @@
Geolocation::Geolocation(ScriptExecutionContext* context)
: ActiveDOMObject(context)
, m_allowGeolocation(Unknown)
-#if PLATFORM(IOS)
, m_isSuspended(false)
, m_hasChangedPosition(false)
, m_resumeTimer(*this, &Geolocation::resumeTimerFired)
-#endif
{
}
@@ -263,7 +261,6 @@
return document() ? document()->page() : nullptr;
}
-#if PLATFORM(IOS)
bool Geolocation::canSuspend() const
{
return !hasListeners();
@@ -378,7 +375,6 @@
for (size_t i = 0; i < watcherCopy.size(); ++i)
startRequest(watcherCopy[i].get());
}
-#endif // PLATFORM(IOS)
void Geolocation::stop()
{
@@ -389,10 +385,8 @@
m_allowGeolocation = Unknown;
cancelAllRequests();
stopUpdating();
-#if PLATFORM(IOS)
m_hasChangedPosition = false;
m_errorWaitingForResume = nullptr;
-#endif // PLATFORM(IOS)
m_pendingForPermissionNotifiers.clear();
}
@@ -555,10 +549,8 @@
// position.
m_allowGeolocation = allowed ? Yes : No;
-#if PLATFORM(IOS)
if (m_isSuspended)
return;
-#endif
// Permission request was made during the startRequest process
if (!m_pendingForPermissionNotifiers.isEmpty()) {
@@ -572,10 +564,8 @@
error->setIsFatal(true);
handleError(error.get());
m_requestsAwaitingCachedPosition.clear();
-#if PLATFORM(IOS)
m_hasChangedPosition = false;
m_errorWaitingForResume = nullptr;
-#endif
return;
}
@@ -756,24 +746,20 @@
// Stop all currently running timers.
stopTimers();
-#if PLATFORM(IOS)
if (m_isSuspended) {
m_hasChangedPosition = true;
return;
}
-#endif
makeSuccessCallbacks();
}
void Geolocation::setError(GeolocationError* error)
{
-#if PLATFORM(IOS)
if (m_isSuspended) {
m_errorWaitingForResume = createPositionError(error);
return;
}
-#endif
RefPtr<PositionError> positionError = createPositionError(error);
handleError(positionError.get());
}
Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.h (178299 => 178300)
--- 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)
@@ -54,12 +54,10 @@
static Ref<Geolocation> create(ScriptExecutionContext*);
WEBCORE_EXPORT ~Geolocation();
-#if PLATFORM(IOS)
virtual bool canSuspend() const override;
virtual void suspend(ReasonForSuspension) override;
virtual void resume() override;
WEBCORE_EXPORT void resetAllGeolocationPermission();
-#endif // PLATFORM(IOS)
Document* document() const;
WEBCORE_EXPORT Frame* frame() const;
@@ -182,7 +180,6 @@
Yes,
No
} m_allowGeolocation;
-#if PLATFORM(IOS)
bool m_isSuspended;
bool m_resetOnResume;
bool m_hasChangedPosition;
@@ -190,7 +187,6 @@
void resumeTimerFired();
Timer m_resumeTimer;
-#endif // PLATFORM(IOS)
GeoNotifierSet m_requestsAwaitingCachedPosition;
};