Title: [251820] trunk
Revision
251820
Author
[email protected]
Date
2019-10-30 16:29:22 -0700 (Wed, 30 Oct 2019)

Log Message

GPUCanvasContext should not prevent entering the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=203104
<rdar://problem/56748066>

Reviewed by Tim Horton.

Source/WebCore:

Let pages with a GPUCanvasContext into the back/forward cache. The current implementation
does not run any script.

Test: fast/history/page-cache-gpu-canvas-context.html

* Modules/webgpu/GPUCanvasContext.h:

LayoutTests:

Add layout test coverage.

* fast/history/page-cache-gpu-canvas-context-expected.txt: Added.
* fast/history/page-cache-gpu-canvas-context.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (251819 => 251820)


--- trunk/LayoutTests/ChangeLog	2019-10-30 23:18:09 UTC (rev 251819)
+++ trunk/LayoutTests/ChangeLog	2019-10-30 23:29:22 UTC (rev 251820)
@@ -1,3 +1,16 @@
+2019-10-30  Chris Dumez  <[email protected]>
+
+        GPUCanvasContext should not prevent entering the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=203104
+        <rdar://problem/56748066>
+
+        Reviewed by Tim Horton.
+
+        Add layout test coverage.
+
+        * fast/history/page-cache-gpu-canvas-context-expected.txt: Added.
+        * fast/history/page-cache-gpu-canvas-context.html: Added.
+
 2019-10-30  Yury Semikhatsky  <[email protected]>
 
         [GTK] LayoutTests/inspector tests timeout

Added: trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context-expected.txt (0 => 251820)


--- trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context-expected.txt	2019-10-30 23:29:22 UTC (rev 251820)
@@ -0,0 +1,13 @@
+Tests that a page with a running GPUCanvasContext goes into the back/forward cache.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+pageshow - not from cache
+pagehide - entering cache
+pageshow - from cache
+PASS Page did enter and was restored from the back/forward cache
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context.html (0 => 251820)


--- trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context.html	                        (rev 0)
+++ trunk/LayoutTests/fast/history/page-cache-gpu-canvas-context.html	2019-10-30 23:29:22 UTC (rev 251820)
@@ -0,0 +1,37 @@
+<!-- webkit-test-runner [ enableBackForwardCache=true ] -->
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description('Tests that a page with a running GPUCanvasContext goes into the back/forward cache.');
+window.jsTestIsAsync = true;
+
+window.addEventListener("pageshow", function(event) {
+    debug("pageshow - " + (event.persisted ? "" : "not ") + "from cache");
+
+    if (event.persisted) {
+        testPassed("Page did enter and was restored from the back/forward cache");
+        finishJSTest();
+    }
+}, false);
+
+window.addEventListener("pagehide", function(event) {
+    debug("pagehide - " + (event.persisted ? "" : "not ") + "entering cache");
+    if (!event.persisted) {
+        testFailed("Page failed to enter the back/forward cache.");
+        finishJSTest();
+    }
+}, false);
+
+window.addEventListener('load', function() {
+    context = document.createElement("canvas").getContext("gpu");
+
+    setTimeout(function() {
+        // Force a back navigation back to this page.
+        window.location.href = ""
+    }, 0);
+}, false);
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (251819 => 251820)


--- trunk/Source/WebCore/ChangeLog	2019-10-30 23:18:09 UTC (rev 251819)
+++ trunk/Source/WebCore/ChangeLog	2019-10-30 23:29:22 UTC (rev 251820)
@@ -1,3 +1,18 @@
+2019-10-30  Chris Dumez  <[email protected]>
+
+        GPUCanvasContext should not prevent entering the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=203104
+        <rdar://problem/56748066>
+
+        Reviewed by Tim Horton.
+
+        Let pages with a GPUCanvasContext into the back/forward cache. The current implementation
+        does not run any script.
+
+        Test: fast/history/page-cache-gpu-canvas-context.html
+
+        * Modules/webgpu/GPUCanvasContext.h:
+
 2019-10-30  Daniel Bates  <[email protected]>
 
         Move tracking and computation of timer heap current insertion order to ThreadTimers

Modified: trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.h (251819 => 251820)


--- trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.h	2019-10-30 23:18:09 UTC (rev 251819)
+++ trunk/Source/WebCore/Modules/webgpu/GPUCanvasContext.h	2019-10-30 23:29:22 UTC (rev 251820)
@@ -46,9 +46,6 @@
     WebGPUSwapChain* swapChain() const { return m_swapChain.get(); }
     Ref<WebGPUSwapChain> configureSwapChain(const WebGPUSwapChainDescriptor&);
 
-    // FIXME: Stubs.
-    bool hasPendingActivity() const final { return false; }
-
 private:
     GPUCanvasContext(CanvasBase&);
 
@@ -57,10 +54,11 @@
     PlatformLayer* platformLayer() const final;
     void reshape(int width, int height) final;
     void markLayerComposited() final;
+
+    // ActiveDOMObject.
     const char* activeDOMObjectName() const final { return "GPUCanvasContext"; }
     // FIXME: Stubs.
     void stop() final { }
-    bool shouldPreventEnteringBackForwardCache_DEPRECATED() const final { return true; } // FIXME: This should never prevent entering the back/forward cache.
 
     RefPtr<WebGPUSwapChain> m_swapChain;
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to