Changeset 215730 in webkit


Ignore:
Timestamp:
Apr 25, 2017 7:14:00 AM (7 years ago)
Author:
Antti Koivisto
Message:

Enable expired-only reload policy on Mac and iOS
https://bugs.webkit.org/show_bug.cgi?id=171264
<rdar://problem/31807637>

Reviewed by Andreas Kling.

Source/WebCore:

  • loader/NavigationAction.cpp:

(WebCore::navigationType):

Test for reload navigation type correctly.

Source/WebKit2:

Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
The behavor is enabled in Safari and for other clients based on SDK version check.

  • UIProcess/API/C/WKPage.cpp:

(WKPageReload):

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView reload]):

  • UIProcess/Cocoa/VersionChecks.h:

LayoutTests:

  • fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html:

WebKitDisplayImages preference blocks loads, it does not prevent images already in memory cache from displaying.
Modify the test to clear the memory cache so it still tests what it is supposed to.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r215726 r215730  
     12017-04-25  Antti Koivisto  <antti@apple.com>
     2
     3        Enable expired-only reload policy on Mac and iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=171264
     5        <rdar://problem/31807637>
     6
     7        Reviewed by Andreas Kling.
     8
     9        * fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html:
     10
     11        WebKitDisplayImages preference blocks loads, it does not prevent images already in memory cache from displaying.
     12        Modify the test to clear the memory cache so it still tests what it is supposed to.
     13
    1142017-04-25  Frederic Wang  <fwang@igalia.com>
    215
  • trunk/LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html

    r129462 r215730  
    1111    window.internals.settings.setImagesEnabled(true);
    1212    testRunner.overridePreference('WebKitDisplayImagesKey', 0);
     13    window.internals.clearMemoryCache();
    1314    testRunner.queueReload();
    1415}
  • trunk/Source/WebCore/ChangeLog

    r215729 r215730  
     12017-04-25  Antti Koivisto  <antti@apple.com>
     2
     3        Enable expired-only reload policy on Mac and iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=171264
     5        <rdar://problem/31807637>
     6
     7        Reviewed by Andreas Kling.
     8
     9        * loader/NavigationAction.cpp:
     10        (WebCore::navigationType):
     11
     12        Test for reload navigation type correctly.
     13
    1142017-04-25  Miguel Gomez  <magomez@igalia.com>
    215
  • trunk/Source/WebCore/loader/NavigationAction.cpp

    r203338 r215730  
    4242    if (haveEvent)
    4343        return NavigationType::LinkClicked;
    44     if (frameLoadType == FrameLoadType::Reload || frameLoadType == FrameLoadType::ReloadFromOrigin)
     44    if (isReload(frameLoadType))
    4545        return NavigationType::Reload;
    4646    if (isBackForwardLoadType(frameLoadType))
  • trunk/Source/WebKit2/ChangeLog

    r215724 r215730  
     12017-04-25  Antti Koivisto  <antti@apple.com>
     2
     3        Enable expired-only reload policy on Mac and iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=171264
     5        <rdar://problem/31807637>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Enable the reload policy where only expired subresources are revalidated on Mac and iOS.
     10        The behavor is enabled in Safari and for other clients based on SDK version check.
     11
     12        * UIProcess/API/C/WKPage.cpp:
     13        (WKPageReload):
     14        * UIProcess/API/Cocoa/WKWebView.mm:
     15        (-[WKWebView reload]):
     16        * UIProcess/Cocoa/VersionChecks.h:
     17
    1182017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
    219
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r215138 r215730  
    9494#endif
    9595
     96#if PLATFORM(COCOA)
     97#include "VersionChecks.h"
     98#endif
     99
    96100using namespace WebCore;
    97101using namespace WebKit;
     
    243247void WKPageReload(WKPageRef pageRef)
    244248{
    245     toImpl(pageRef)->reload({ });
     249    OptionSet<WebCore::ReloadOption> reloadOptions;
     250#if PLATFORM(COCOA)
     251    if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
     252        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
     253#endif
     254
     255    toImpl(pageRef)->reload(reloadOptions);
    246256}
    247257
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r215653 r215730  
    843843- (WKNavigation *)reload
    844844{
    845     auto navigation = _page->reload({ });
     845    OptionSet<WebCore::ReloadOption> reloadOptions;
     846    if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
     847        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
     848
     849    auto navigation = _page->reload(reloadOptions);
    846850    if (!navigation)
    847851        return nil;
  • trunk/Source/WebKit2/UIProcess/Cocoa/VersionChecks.h

    r215421 r215730  
    3737    FirstToExcludeLocalStorageFromBackup = DYLD_IOS_VERSION_11_0,
    3838    FirstToUseSelectionGranularityCharacterByDefault = DYLD_IOS_VERSION_11_0,
     39    FirstWithExpiredOnlyReloadBehavior = DYLD_IOS_VERSION_11_0,
    3940#elif PLATFORM(MAC)
    4041    FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
    4142    FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
    42     FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13
     43    FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13,
     44    FirstWithExpiredOnlyReloadBehavior = DYLD_MACOSX_VERSION_10_13,
    4345#endif
    4446};
Note: See TracChangeset for help on using the changeset viewer.