Title: [226659] trunk
Revision
226659
Author
[email protected]
Date
2018-01-09 15:00:48 -0800 (Tue, 09 Jan 2018)

Log Message

Unreviewed, rolling out r226531.

This caused test failures on macOS WK2.

Reverted changeset:

"Use no-cache fetch mode when loading main documents with
location.reload()"
https://bugs.webkit.org/show_bug.cgi?id=181285
https://trac.webkit.org/changeset/226531

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (226658 => 226659)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-01-09 23:00:48 UTC (rev 226659)
@@ -1,3 +1,16 @@
+2018-01-09  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r226531.
+
+        This caused test failures on macOS WK2.
+
+        Reverted changeset:
+
+        "Use no-cache fetch mode when loading main documents with
+        location.reload()"
+        https://bugs.webkit.org/show_bug.cgi?id=181285
+        https://trac.webkit.org/changeset/226531
+
 2018-01-09  Youenn Fablet  <[email protected]>
 
         Make imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html robust to quota error

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt (226658 => 226659)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event.https-expected.txt	2018-01-09 23:00:48 UTC (rev 226659)
@@ -1,4 +1,5 @@
 
+
 PASS Service Worker headers in the request of a fetch event 
 PASS Service Worker responds to fetch event with string 
 PASS Service Worker responds to fetch event with blob body 
@@ -11,7 +12,7 @@
 PASS Multiple calls of respondWith must throw InvalidStateErrors 
 PASS Service Worker event.respondWith must set the used flag 
 PASS Service Worker should expose FetchEvent URL fragments. 
-PASS Service Worker responds to fetch event with the correct cache types 
+FAIL Service Worker responds to fetch event with the correct cache types assert_unreached: unexpected rejection: assert_equals: expected "no-cache" but got "default" Reached unreachable code
 PASS Service Worker should intercept EventSource 
 PASS Service Worker responds to fetch event with the correct integrity_metadata 
 PASS FetchEvent#body is a string 

Modified: trunk/Source/WebCore/ChangeLog (226658 => 226659)


--- trunk/Source/WebCore/ChangeLog	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/Source/WebCore/ChangeLog	2018-01-09 23:00:48 UTC (rev 226659)
@@ -1,3 +1,16 @@
+2018-01-09  Matt Lewis  <[email protected]>
+
+        Unreviewed, rolling out r226531.
+
+        This caused test failures on macOS WK2.
+
+        Reverted changeset:
+
+        "Use no-cache fetch mode when loading main documents with
+        location.reload()"
+        https://bugs.webkit.org/show_bug.cgi?id=181285
+        https://trac.webkit.org/changeset/226531
+
 2018-01-09  Michael Saboff  <[email protected]>
 
         Unreviewed, rolling out r226600 and r226603

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (226658 => 226659)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2018-01-09 23:00:48 UTC (rev 226659)
@@ -1607,32 +1607,9 @@
     });
 }
 
-static inline FetchOptions::Cache toFetchOptionsCache(ResourceRequestCachePolicy policy)
-{
-    // We are setting FetchOptions::Cache values to keep current behavior consistency.
-    // FIXME: We should merge FetchOptions::Cache with ResourceRequestCachePolicy and merge related class members.
-    switch (policy) {
-    case UseProtocolCachePolicy:
-        return FetchOptions::Cache::Default;
-    case ReloadIgnoringCacheData:
-        return FetchOptions::Cache::Reload;
-    case ReturnCacheDataElseLoad:
-        return FetchOptions::Cache::Default;
-    case ReturnCacheDataDontLoad:
-        return FetchOptions::Cache::Default;
-    case DoNotUseAnyCache:
-        return FetchOptions::Cache::NoStore;
-    case RefreshAnyCacheData:
-        return FetchOptions::Cache::NoCache;
-    }
-    return FetchOptions::Cache::Default;
-}
-
 void DocumentLoader::loadMainResource(ResourceRequest&& request)
 {
-    ResourceLoaderOptions mainResourceLoadOptions { SendCallbacks, SniffContent, BufferData, StoredCredentialsPolicy::Use, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::Navigate, IncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching };
-    mainResourceLoadOptions.cache = toFetchOptionsCache(request.cachePolicy());
-
+    static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, StoredCredentialsPolicy::Use, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::Navigate, IncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching);
     CachedResourceRequest mainResourceRequest(ResourceRequest(request), mainResourceLoadOptions);
     if (!m_frame->isMainFrame() && m_frame->document()) {
         // If we are loading the main resource of a subframe, use the cache partition of the main document.

Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (226658 => 226659)


--- trunk/Source/WebCore/loader/FrameLoader.cpp	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2018-01-09 23:00:48 UTC (rev 226659)
@@ -1193,12 +1193,10 @@
         referrer = String();
 
     FrameLoadType loadType;
-    if (request.resourceRequest().cachePolicy() == RefreshAnyCacheData)
+    if (request.resourceRequest().cachePolicy() == ReloadIgnoringCacheData)
         loadType = FrameLoadType::Reload;
     else if (request.lockBackForwardList() == LockBackForwardList::Yes)
         loadType = FrameLoadType::RedirectWithLockedBackForwardList;
-    else if (request.resourceRequest().cachePolicy() == ReloadIgnoringCacheData)
-        loadType = FrameLoadType::ReloadFromOrigin;
     else
         loadType = FrameLoadType::Standard;
 
@@ -1283,7 +1281,7 @@
 
     addExtraFieldsToRequest(request, newLoadType, true);
     if (isReload(newLoadType))
-        request.setCachePolicy(RefreshAnyCacheData);
+        request.setCachePolicy(ReloadIgnoringCacheData);
 
     ASSERT(newLoadType != FrameLoadType::Same);
 
@@ -1418,7 +1416,7 @@
     FrameLoadType type;
 
     if (shouldTreatURLAsSameAsCurrent(newDocumentLoader->originalRequest().url())) {
-        r.setCachePolicy(RefreshAnyCacheData);
+        r.setCachePolicy(ReloadIgnoringCacheData);
         type = FrameLoadType::Same;
     } else if (shouldTreatURLAsSameAsCurrent(newDocumentLoader->unreachableURL()) && m_loadType == FrameLoadType::Reload)
         type = FrameLoadType::Reload;
@@ -1643,7 +1641,8 @@
     
     ResourceRequest& request = loader->request();
 
-    request.setCachePolicy(RefreshAnyCacheData);
+    // FIXME: We don't have a mechanism to revalidate the main resource without reloading at the moment.
+    request.setCachePolicy(ReloadIgnoringCacheData);
 
     // If we're about to re-post, set up action so the application can warn the user.
     if (request.httpMethod() == "POST")
@@ -2615,13 +2614,13 @@
 
     if (isMainResource) {
         if (isReload(loadType) || request.isConditional())
-            return loadType == FrameLoadType::ReloadFromOrigin ? ReloadIgnoringCacheData : RefreshAnyCacheData;
+            return ReloadIgnoringCacheData;
 
         return UseProtocolCachePolicy;
     }
 
     if (request.isConditional())
-        return RefreshAnyCacheData;
+        return ReloadIgnoringCacheData;
 
     if (documentLoader()->isLoadingInAPISense()) {
         // If we inherit cache policy from a main resource, we use the DocumentLoader's
@@ -3479,10 +3478,8 @@
     } else {
         switch (loadType) {
         case FrameLoadType::Reload:
+        case FrameLoadType::ReloadFromOrigin:
         case FrameLoadType::ReloadExpiredOnly:
-            request.setCachePolicy(RefreshAnyCacheData);
-            break;
-        case FrameLoadType::ReloadFromOrigin:
             request.setCachePolicy(ReloadIgnoringCacheData);
             break;
         case FrameLoadType::Back:

Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (226658 => 226659)


--- trunk/Source/WebCore/loader/NavigationScheduler.cpp	2018-01-09 21:47:22 UTC (rev 226658)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp	2018-01-09 23:00:48 UTC (rev 226659)
@@ -182,7 +182,7 @@
         UserGestureIndicator gestureIndicator { userGestureToForward() };
 
         bool refresh = equalIgnoringFragmentIdentifier(frame.document()->url(), url());
-        ResourceRequest resourceRequest { url(), referrer(), refresh ? RefreshAnyCacheData : UseProtocolCachePolicy };
+        ResourceRequest resourceRequest { url(), referrer(), refresh ? ReloadIgnoringCacheData : UseProtocolCachePolicy };
         FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), resourceRequest, "_self", lockHistory(), lockBackForwardList(), MaybeSendReferrer, AllowNavigationToInvalidURL::No, NewFrameOpenerPolicy::Allow, shouldOpenExternalURLs(), initiatedByMainFrame() };
 
         frame.loader().changeLocation(WTFMove(frameLoadRequest));
@@ -216,7 +216,7 @@
     {
         UserGestureIndicator gestureIndicator { userGestureToForward() };
 
-        ResourceRequest resourceRequest { url(), referrer(), RefreshAnyCacheData };
+        ResourceRequest resourceRequest { url(), referrer(), ReloadIgnoringCacheData };
         FrameLoadRequest frameLoadRequest { initiatingDocument(), *securityOrigin(), resourceRequest, "_self", lockHistory(), lockBackForwardList(), MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, shouldOpenExternalURLs(), initiatedByMainFrame() };
 
         frame.loader().changeLocation(WTFMove(frameLoadRequest));
@@ -319,7 +319,7 @@
         ResourceResponse replacementResponse { m_originDocument.url(), ASCIILiteral("text/plain"), 0, ASCIILiteral("UTF-8") };
         SubstituteData replacementData { SharedBuffer::create(), m_originDocument.url(), replacementResponse, SubstituteData::SessionHistoryVisibility::Hidden };
 
-        ResourceRequest resourceRequest { m_originDocument.url(), emptyString(), RefreshAnyCacheData };
+        ResourceRequest resourceRequest { m_originDocument.url(), emptyString(), ReloadIgnoringCacheData };
         FrameLoadRequest frameLoadRequest { m_originDocument, m_originDocument.securityOrigin(), resourceRequest, { }, lockHistory(), lockBackForwardList(), MaybeSendReferrer, AllowNavigationToInvalidURL::Yes, NewFrameOpenerPolicy::Allow, shouldOpenExternalURLs(), initiatedByMainFrame() };
         frameLoadRequest.setSubstituteData(replacementData);
         frame.loader().load(WTFMove(frameLoadRequest));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to