Title: [215730] trunk
Revision
215730
Author
an...@apple.com
Date
2017-04-25 07:14:00 -0700 (Tue, 25 Apr 2017)

Log 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.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (215729 => 215730)


--- trunk/LayoutTests/ChangeLog	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/LayoutTests/ChangeLog	2017-04-25 14:14:00 UTC (rev 215730)
@@ -1,3 +1,16 @@
+2017-04-25  Antti Koivisto  <an...@apple.com>
+
+        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.
+
+        * 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.
+
 2017-04-25  Frederic Wang  <fw...@igalia.com>
 
         Import W3C tests for the CSSOM View module

Modified: trunk/LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html (215729 => 215730)


--- trunk/LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/LayoutTests/fast/loader/display-image-unset-can-block-image-and-can-reload-in-place.html	2017-04-25 14:14:00 UTC (rev 215730)
@@ -10,6 +10,7 @@
     testRunner.dumpAsText();
     window.internals.settings.setImagesEnabled(true);
     testRunner.overridePreference('WebKitDisplayImagesKey', 0);
+    window.internals.clearMemoryCache();
     testRunner.queueReload();
 }
 

Modified: trunk/Source/WebCore/ChangeLog (215729 => 215730)


--- trunk/Source/WebCore/ChangeLog	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebCore/ChangeLog	2017-04-25 14:14:00 UTC (rev 215730)
@@ -1,3 +1,16 @@
+2017-04-25  Antti Koivisto  <an...@apple.com>
+
+        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.
+
+        * loader/NavigationAction.cpp:
+        (WebCore::navigationType):
+
+        Test for reload navigation type correctly.
+
 2017-04-25  Miguel Gomez  <mago...@igalia.com>
 
         Image decoders must have private constructors to avoid refcount misuse: ASSERTION FAILED: m_deletionHasBegun when destroying ImageDecoder

Modified: trunk/Source/WebCore/loader/NavigationAction.cpp (215729 => 215730)


--- trunk/Source/WebCore/loader/NavigationAction.cpp	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebCore/loader/NavigationAction.cpp	2017-04-25 14:14:00 UTC (rev 215730)
@@ -41,7 +41,7 @@
         return NavigationType::FormSubmitted;
     if (haveEvent)
         return NavigationType::LinkClicked;
-    if (frameLoadType == FrameLoadType::Reload || frameLoadType == FrameLoadType::ReloadFromOrigin)
+    if (isReload(frameLoadType))
         return NavigationType::Reload;
     if (isBackForwardLoadType(frameLoadType))
         return NavigationType::BackForward;

Modified: trunk/Source/WebKit2/ChangeLog (215729 => 215730)


--- trunk/Source/WebKit2/ChangeLog	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebKit2/ChangeLog	2017-04-25 14:14:00 UTC (rev 215730)
@@ -1,3 +1,20 @@
+2017-04-25  Antti Koivisto  <an...@apple.com>
+
+        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.
+
+        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:
+
 2017-04-25  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Support reading NSURL titles from the pasteboard when performing data interaction

Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp (215729 => 215730)


--- trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp	2017-04-25 14:14:00 UTC (rev 215730)
@@ -93,6 +93,10 @@
 #include <WebCore/MediaSessionEvents.h>
 #endif
 
+#if PLATFORM(COCOA)
+#include "VersionChecks.h"
+#endif
+
 using namespace WebCore;
 using namespace WebKit;
 
@@ -242,7 +246,13 @@
 
 void WKPageReload(WKPageRef pageRef)
 {
-    toImpl(pageRef)->reload({ });
+    OptionSet<WebCore::ReloadOption> reloadOptions;
+#if PLATFORM(COCOA)
+    if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
+        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
+#endif
+
+    toImpl(pageRef)->reload(reloadOptions);
 }
 
 void WKPageReloadWithoutContentBlockers(WKPageRef pageRef)

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (215729 => 215730)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-04-25 14:14:00 UTC (rev 215730)
@@ -842,7 +842,11 @@
 
 - (WKNavigation *)reload
 {
-    auto navigation = _page->reload({ });
+    OptionSet<WebCore::ReloadOption> reloadOptions;
+    if (linkedOnOrAfter(WebKit::SDKVersion::FirstWithExpiredOnlyReloadBehavior))
+        reloadOptions |= WebCore::ReloadOption::ExpiredOnly;
+
+    auto navigation = _page->reload(reloadOptions);
     if (!navigation)
         return nil;
 

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/VersionChecks.h (215729 => 215730)


--- trunk/Source/WebKit2/UIProcess/Cocoa/VersionChecks.h	2017-04-25 12:35:18 UTC (rev 215729)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/VersionChecks.h	2017-04-25 14:14:00 UTC (rev 215730)
@@ -36,10 +36,12 @@
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_IOS_VERSION_11_0,
     FirstToExcludeLocalStorageFromBackup = DYLD_IOS_VERSION_11_0,
     FirstToUseSelectionGranularityCharacterByDefault = DYLD_IOS_VERSION_11_0,
+    FirstWithExpiredOnlyReloadBehavior = DYLD_IOS_VERSION_11_0,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,
-    FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13
+    FirstWithDropToNavigateDisallowedByDefault = DYLD_MACOSX_VERSION_10_13,
+    FirstWithExpiredOnlyReloadBehavior = DYLD_MACOSX_VERSION_10_13,
 #endif
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to