Title: [250754] trunk
Revision
250754
Author
cdu...@apple.com
Date
2019-10-04 16:12:45 -0700 (Fri, 04 Oct 2019)

Log Message

Allow pages using IDBIndex to enter the PageCache
https://bugs.webkit.org/show_bug.cgi?id=202430
<rdar://problem/55887918>

Reviewed by Geoffrey Garen.

Source/WebCore:

There is no reason to prevent PageCaching when an IDBIndex object is alive.
No events are fired by IDBIndex and its API returns IDBRequest objects, which
are already PageCache-aware.

I have seen Yahoo.com failing to enter the back/forward cache because of this.

No new tests, updated existing test.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::canSuspendForDocumentSuspension const):

LayoutTests:

Extend layout test coverage.

* storage/indexeddb/IDBTransaction-page-cache-expected.txt:
* storage/indexeddb/IDBTransaction-page-cache.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (250753 => 250754)


--- trunk/LayoutTests/ChangeLog	2019-10-04 22:34:39 UTC (rev 250753)
+++ trunk/LayoutTests/ChangeLog	2019-10-04 23:12:45 UTC (rev 250754)
@@ -1,3 +1,16 @@
+2019-10-04  Chris Dumez  <cdu...@apple.com>
+
+        Allow pages using IDBIndex to enter the PageCache
+        https://bugs.webkit.org/show_bug.cgi?id=202430
+        <rdar://problem/55887918>
+
+        Reviewed by Geoffrey Garen.
+
+        Extend layout test coverage.
+
+        * storage/indexeddb/IDBTransaction-page-cache-expected.txt:
+        * storage/indexeddb/IDBTransaction-page-cache.html:
+
 2019-10-04  Truitt Savell  <tsav...@apple.com>
 
         Layout Test imported/w3c/web-platform-tests/2dcontext/line-styles/2d.line.cap.round.html is failing

Modified: trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache-expected.txt (250753 => 250754)


--- trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache-expected.txt	2019-10-04 22:34:39 UTC (rev 250753)
+++ trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache-expected.txt	2019-10-04 23:12:45 UTC (rev 250754)
@@ -1,9 +1,10 @@
-Tests that an IDBRequest does not prevent page caching.
+Tests that an IDBRequest & IDBIndex does not prevent page caching.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
 pageshow - not from page cache
+PASS !!myIndex is true
 pagehide - entering page cache
 pageshow - from page cache
 PASS Page entered page cache

Modified: trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache.html (250753 => 250754)


--- trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache.html	2019-10-04 22:34:39 UTC (rev 250753)
+++ trunk/LayoutTests/storage/indexeddb/IDBTransaction-page-cache.html	2019-10-04 23:12:45 UTC (rev 250754)
@@ -4,7 +4,7 @@
 <body>
 <script src=""
 <script>
-description("Tests that an IDBRequest does not prevent page caching.");
+description("Tests that an IDBRequest & IDBIndex does not prevent page caching.");
 jsTestIsAsync = true;
 
 window.addEventListener("pageshow", function(event) {
@@ -35,6 +35,9 @@
              objectStore = db.createObjectStore("customers", { keyPath: "ssn" });
              transaction = objectStore.transaction;
 
+             myIndex = objectStore.createIndex('index', 'x', {unique: true});
+             shouldBeTrue("!!myIndex");
+
              window.location = "../../fast/history/resources/page-cache-helper.html";
          };
     }, 0);

Modified: trunk/Source/WebCore/ChangeLog (250753 => 250754)


--- trunk/Source/WebCore/ChangeLog	2019-10-04 22:34:39 UTC (rev 250753)
+++ trunk/Source/WebCore/ChangeLog	2019-10-04 23:12:45 UTC (rev 250754)
@@ -1,3 +1,22 @@
+2019-10-04  Chris Dumez  <cdu...@apple.com>
+
+        Allow pages using IDBIndex to enter the PageCache
+        https://bugs.webkit.org/show_bug.cgi?id=202430
+        <rdar://problem/55887918>
+
+        Reviewed by Geoffrey Garen.
+
+        There is no reason to prevent PageCaching when an IDBIndex object is alive.
+        No events are fired by IDBIndex and its API returns IDBRequest objects, which
+        are already PageCache-aware.
+
+        I have seen Yahoo.com failing to enter the back/forward cache because of this.
+
+        No new tests, updated existing test.
+
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::canSuspendForDocumentSuspension const):
+
 2019-10-04  Heiko Becker  <heire...@exherbo.org>
 
         Fix build with icu 65.1

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (250753 => 250754)


--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp	2019-10-04 22:34:39 UTC (rev 250753)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp	2019-10-04 23:12:45 UTC (rev 250754)
@@ -64,7 +64,7 @@
 
 bool IDBIndex::canSuspendForDocumentSuspension() const
 {
-    return false;
+    return true;
 }
 
 bool IDBIndex::hasPendingActivity() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to