Changeset 251275 in webkit


Ignore:
Timestamp:
Oct 17, 2019 10:01:50 PM (4 years ago)
Author:
Chris Dumez
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.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251273 r251275  
     12019-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
     4        https://bugs.webkit.org/show_bug.cgi?id=203108
     5        <rdar://problem/56375671>
     6
     7        Reviewed by Geoff Garen.
     8
     9        * http/tests/navigation/page-cache-pending-load.html:
     10        Tweak test to add the stylesheet to the body instead of the head since a document
     11        with a pending stylesheet before the body qualifies as visually empty. The test
     12        would be flaky otherwise.
     13
    1142019-10-17  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/LayoutTests/http/tests/navigation/page-cache-pending-load.html

    r251220 r251275  
    3434    link.type = "text/css";
    3535    link.href = "/incremental/resources/slow-utf8-css.pl";
    36     document.head.appendChild(link);
     36    document.body.appendChild(link);
    3737
    3838    var script = document.createElement("script");
  • trunk/Source/WebCore/ChangeLog

    r251273 r251275  
     12019-10-17  Chris Dumez  <cdumez@apple.com>
     2
     3        Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
     4        https://bugs.webkit.org/show_bug.cgi?id=203108
     5        <rdar://problem/56375671>
     6
     7        Reviewed by Geoff Garen.
     8
     9        We don't want to go back to a visually empty page on back/forward navigation.
     10
     11        * history/BackForwardCache.cpp:
     12        (WebCore::canCacheFrame):
     13        * page/DiagnosticLoggingKeys.cpp:
     14        (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
     15        * page/DiagnosticLoggingKeys.h:
     16
    1172019-10-17  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebCore/history/BackForwardCache.cpp

    r251267 r251275  
    133133        isCacheable = false;
    134134    }
     135    if (frame.isMainFrame() && frame.view() && !frame.view()->isVisuallyNonEmpty()) {
     136        PCLOG("   -Main frame is visually empty");
     137        logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::visuallyEmptyKey());
     138        isCacheable = false;
     139    }
    135140    if (frameLoader.quickRedirectComing()) {
    136141        PCLOG("   -Quick redirect is coming");
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp

    r251267 r251275  
    219219}
    220220
     221String DiagnosticLoggingKeys::visuallyEmptyKey()
     222{
     223    return "visuallyEmpty"_s;
     224}
     225
    221226String DiagnosticLoggingKeys::noDocumentLoaderKey()
    222227{
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.h

    r251267 r251275  
    117117    static String backForwardCacheKey();
    118118    static String backForwardCacheFailureKey();
     119    static String visuallyEmptyKey();
    119120    static String pageContainsAtLeastOneMediaEngineKey();
    120121    static String pageContainsAtLeastOnePluginKey();
Note: See TracChangeset for help on using the changeset viewer.