Diff
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog (227876 => 227877)
--- branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-01-31 08:13:59 UTC (rev 227877)
@@ -1,5 +1,18 @@
2018-01-30 Jason Marcell <[email protected]>
+ Cherry-pick r227625. rdar://problem/37019502
+
+ 2018-01-25 Youenn Fablet <[email protected]>
+
+ DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
+ https://bugs.webkit.org/show_bug.cgi?id=182115
+
+ Reviewed by Alex Christensen.
+
+ * web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:
+
+2018-01-30 Jason Marcell <[email protected]>
+
Cherry-pick r227680. rdar://problem/37019528
2018-01-26 Youenn Fablet <[email protected]>
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt (227876 => 227877)
--- branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt 2018-01-31 08:13:59 UTC (rev 227877)
@@ -5,7 +5,7 @@
FAIL Normal redirect to same-origin scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
FAIL Normal redirect to other-origin scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
FAIL SW-fallbacked redirect to same-origin out-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
-FAIL SW-fallbacked redirect to same-origin same-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
+PASS SW-fallbacked redirect to same-origin same-scope.
FAIL SW-fallbacked redirect to same-origin other-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
FAIL SW-fallbacked redirect to other-origin out-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
FAIL SW-fallbacked redirect to other-origin in-scope. promise_test: Unhandled rejection with value: object "NotSupportedError: Passing MessagePort objects to postMessage is not yet supported"
Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227876 => 227877)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-01-31 08:13:59 UTC (rev 227877)
@@ -1,5 +1,24 @@
2018-01-30 Jason Marcell <[email protected]>
+ Cherry-pick r227625. rdar://problem/37019502
+
+ 2018-01-25 Youenn Fablet <[email protected]>
+
+ DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
+ https://bugs.webkit.org/show_bug.cgi?id=182115
+
+ Reviewed by Alex Christensen.
+
+ Covered by rebased test.
+
+ In case a navigation load is going to the network process,
+ we need to interrupt it if having a redirection that leads to a new request going to a service worker.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::redirectReceived):
+
+2018-01-30 Jason Marcell <[email protected]>
+
Cherry-pick r227796. rdar://problem/37037868
2018-01-30 Chris Dumez <[email protected]>
Modified: branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp (227876 => 227877)
--- branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/Source/WebCore/loader/DocumentLoader.cpp 2018-01-31 08:13:59 UTC (rev 227877)
@@ -517,19 +517,22 @@
{
ASSERT_UNUSED(resource, &resource == m_mainResource);
#if ENABLE(SERVICE_WORKER)
- willSendRequest(WTFMove(request), redirectResponse, [completionHandler = WTFMove(completionHandler), protectedThis = makeRef(*this), this] (auto&& request) mutable {
+ bool isRedirectionFromServiceWorker = redirectResponse.source() == ResourceResponse::Source::ServiceWorker;
+ willSendRequest(WTFMove(request), redirectResponse, [isRedirectionFromServiceWorker, completionHandler = WTFMove(completionHandler), protectedThis = makeRef(*this), this] (auto&& request) mutable {
if (request.isNull() || !m_mainDocumentError.isNull() || !m_frame) {
completionHandler({ });
return;
}
auto url = ""
- matchRegistration(url, [request = WTFMove(request), completionHandler = WTFMove(completionHandler), protectedThis = WTFMove(protectedThis), this] (auto&& registrationData) mutable {
+ matchRegistration(url, [request = WTFMove(request), isRedirectionFromServiceWorker, completionHandler = WTFMove(completionHandler), protectedThis = WTFMove(protectedThis), this] (auto&& registrationData) mutable {
if (!m_mainDocumentError.isNull() || !m_frame) {
completionHandler({ });
return;
}
+ bool shouldContinueLoad = areRegistrationsEqual(m_serviceWorkerRegistrationData, registrationData)
+ && isRedirectionFromServiceWorker == !!registrationData;
- if (areRegistrationsEqual(m_serviceWorkerRegistrationData, registrationData)) {
+ if (shouldContinueLoad) {
completionHandler(WTFMove(request));
return;
}
Modified: branches/safari-605-branch/Source/WebKit/ChangeLog (227876 => 227877)
--- branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/Source/WebKit/ChangeLog 2018-01-31 08:13:59 UTC (rev 227877)
@@ -1,5 +1,19 @@
2018-01-30 Jason Marcell <[email protected]>
+ Cherry-pick r227625. rdar://problem/37019502
+
+ 2018-01-25 Youenn Fablet <[email protected]>
+
+ DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
+ https://bugs.webkit.org/show_bug.cgi?id=182115
+
+ Reviewed by Alex Christensen.
+
+ * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
+ (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
+
+2018-01-30 Jason Marcell <[email protected]>
+
Cherry-pick r227789. rdar://problem/37035797
2018-01-30 Chris Dumez <[email protected]>
Modified: branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp (227876 => 227877)
--- branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp 2018-01-31 07:28:23 UTC (rev 227876)
+++ branches/safari-605-branch/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp 2018-01-31 08:13:59 UTC (rev 227877)
@@ -108,6 +108,7 @@
callback(Result::Succeeded);
return;
}
+ response.setSource(ResourceResponse::Source::ServiceWorker);
if (response.isRedirection()) {
m_redirectionStatus = RedirectionStatus::Receiving;
@@ -134,7 +135,6 @@
response.setTextEncodingName(ASCIILiteral("UTF-8"));
}
}
- response.setSource(ResourceResponse::Source::ServiceWorker);
// As per https://fetch.spec.whatwg.org/#main-fetch step 9, copy request's url list in response's url list if empty.
if (response.url().isNull())