Title: [251275] trunk
Revision
251275
Author
[email protected]
Date
2019-10-17 22:01:50 -0700 (Thu, 17 Oct 2019)

Log Message

Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
https://bugs.webkit.org/show_bug.cgi?id=203108
<rdar://problem/56375671>

Reviewed by Geoff Garen.

Source/WebCore:

We don't want to go back to a visually empty page on back/forward navigation.

* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
* page/DiagnosticLoggingKeys.h:

LayoutTests:

* http/tests/navigation/page-cache-pending-load.html:
Tweak test to add the stylesheet to the body instead of the head since a document
with a pending stylesheet before the body qualifies as visually empty. The test
would be flaky otherwise.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (251274 => 251275)


--- trunk/LayoutTests/ChangeLog	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/LayoutTests/ChangeLog	2019-10-18 05:01:50 UTC (rev 251275)
@@ -1,3 +1,16 @@
+2019-10-17  Chris Dumez  <[email protected]>
+
+        Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=203108
+        <rdar://problem/56375671>
+
+        Reviewed by Geoff Garen.
+
+        * http/tests/navigation/page-cache-pending-load.html:
+        Tweak test to add the stylesheet to the body instead of the head since a document
+        with a pending stylesheet before the body qualifies as visually empty. The test
+        would be flaky otherwise.
+
 2019-10-17  Simon Fraser  <[email protected]>
 
         Only include "deep color" in layer tree dumps if a tests requests it

Modified: trunk/LayoutTests/http/tests/navigation/page-cache-pending-load.html (251274 => 251275)


--- trunk/LayoutTests/http/tests/navigation/page-cache-pending-load.html	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/LayoutTests/http/tests/navigation/page-cache-pending-load.html	2019-10-18 05:01:50 UTC (rev 251275)
@@ -33,7 +33,7 @@
     link.rel = "stylesheet";
     link.type = "text/css";
     link.href = ""
-    document.head.appendChild(link);
+    document.body.appendChild(link);
 
     var script = document.createElement("script");
     script.async = true;

Modified: trunk/Source/WebCore/ChangeLog (251274 => 251275)


--- trunk/Source/WebCore/ChangeLog	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/Source/WebCore/ChangeLog	2019-10-18 05:01:50 UTC (rev 251275)
@@ -1,3 +1,19 @@
+2019-10-17  Chris Dumez  <[email protected]>
+
+        Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
+        https://bugs.webkit.org/show_bug.cgi?id=203108
+        <rdar://problem/56375671>
+
+        Reviewed by Geoff Garen.
+
+        We don't want to go back to a visually empty page on back/forward navigation.
+
+        * history/BackForwardCache.cpp:
+        (WebCore::canCacheFrame):
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
+        * page/DiagnosticLoggingKeys.h:
+
 2019-10-17  Simon Fraser  <[email protected]>
 
         Only include "deep color" in layer tree dumps if a tests requests it

Modified: trunk/Source/WebCore/history/BackForwardCache.cpp (251274 => 251275)


--- trunk/Source/WebCore/history/BackForwardCache.cpp	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/Source/WebCore/history/BackForwardCache.cpp	2019-10-18 05:01:50 UTC (rev 251275)
@@ -132,6 +132,11 @@
         logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::noCurrentHistoryItemKey());
         isCacheable = false;
     }
+    if (frame.isMainFrame() && frame.view() && !frame.view()->isVisuallyNonEmpty()) {
+        PCLOG("   -Main frame is visually empty");
+        logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::visuallyEmptyKey());
+        isCacheable = false;
+    }
     if (frameLoader.quickRedirectComing()) {
         PCLOG("   -Quick redirect is coming");
         logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::quirkRedirectComingKey());

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (251274 => 251275)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2019-10-18 05:01:50 UTC (rev 251275)
@@ -218,6 +218,11 @@
     return "backForwardCacheFailure"_s;
 }
 
+String DiagnosticLoggingKeys::visuallyEmptyKey()
+{
+    return "visuallyEmpty"_s;
+}
+
 String DiagnosticLoggingKeys::noDocumentLoaderKey()
 {
     return "noDocumentLoader"_s;

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (251274 => 251275)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2019-10-18 04:35:28 UTC (rev 251274)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2019-10-18 05:01:50 UTC (rev 251275)
@@ -116,6 +116,7 @@
     WEBCORE_EXPORT static String otherKey();
     static String backForwardCacheKey();
     static String backForwardCacheFailureKey();
+    static String visuallyEmptyKey();
     static String pageContainsAtLeastOneMediaEngineKey();
     static String pageContainsAtLeastOnePluginKey();
     static String pageContainsMediaEngineKey();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to