- Revision
- 230489
- Author
- [email protected]
- Date
- 2018-04-10 12:46:40 -0700 (Tue, 10 Apr 2018)
Log Message
Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
https://bugs.webkit.org/show_bug.cgi?id=184268
<rdar://problem/39144446>
Patch by Sihui Liu <[email protected]> on 2018-04-10
Reviewed by Chris Dumez.
Source/WebCore:
The assertion is no longer true after the change, because multiple resources could have same
url. Used if condition here to make sure we only delete specified resource.
No new tests. Updated an existing test to test the stop loading case by not using injected
bundle policy: http/tests/multipart/multipart-html.php.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::removeCachedResource):
Source/WebKit:
Webpage for multipart stream responses failed to refresh because content policy was set to
be ignore when provisonalDocumentLoader was null and navigation ID could not be retrieved.
As loading should not stop in this case, we set navigation ID 0 and still ask for content
policy.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
LayoutTests:
* http/tests/multipart/multipart-html-expected.txt:
* http/tests/multipart/multipart-html.php:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (230488 => 230489)
--- trunk/LayoutTests/ChangeLog 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/LayoutTests/ChangeLog 2018-04-10 19:46:40 UTC (rev 230489)
@@ -1,3 +1,14 @@
+2018-04-10 Sihui Liu <[email protected]>
+
+ Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
+ https://bugs.webkit.org/show_bug.cgi?id=184268
+ <rdar://problem/39144446>
+
+ Reviewed by Chris Dumez.
+
+ * http/tests/multipart/multipart-html-expected.txt:
+ * http/tests/multipart/multipart-html.php:
+
2018-04-10 Ryan Haddad <[email protected]>
Mark imported/w3c/web-platform-tests/workers/name-property.html as flaky.
Modified: trunk/LayoutTests/http/tests/multipart/multipart-html-expected.txt (230488 => 230489)
--- trunk/LayoutTests/http/tests/multipart/multipart-html-expected.txt 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/LayoutTests/http/tests/multipart/multipart-html-expected.txt 2018-04-10 19:46:40 UTC (rev 230489)
@@ -1 +1 @@
-This text should only appear once 10
+PASS: This is message 10.
Modified: trunk/LayoutTests/http/tests/multipart/multipart-html.php (230488 => 230489)
--- trunk/LayoutTests/http/tests/multipart/multipart-html.php 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/LayoutTests/http/tests/multipart/multipart-html.php 2018-04-10 19:46:40 UTC (rev 230489)
@@ -7,8 +7,11 @@
?>
<script>
-if (window.testRunner)
+if (window.testRunner) {
testRunner.dumpAsText();
+ if (testRunner.setShouldDecideResponsePolicyAfterDelay)
+ testRunner.setShouldDecideResponsePolicyAfterDelay(true);
+}
</script>
<?php
@@ -15,12 +18,15 @@
for ($i = 0; $i <= 10; $i++) {
echo "--boundary\r\n";
echo "Content-Type: text/html\r\n\r\n";
- echo "This text should only appear once ";
- echo $i;
+ if ($i < 10) {
+ echo "This is message {$i}.<br>";
+ echo "FAIL: The message number should be 10.";
+ } else {
+ echo "PASS: This is message {$i}.";
+ }
echo str_pad('', 5000);
echo "\r\n\r\n";
flush();
usleep(100000);
- $i++;
}
-?>
+?>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (230488 => 230489)
--- trunk/Source/WebCore/ChangeLog 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/Source/WebCore/ChangeLog 2018-04-10 19:46:40 UTC (rev 230489)
@@ -1,3 +1,20 @@
+2018-04-10 Sihui Liu <[email protected]>
+
+ Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
+ https://bugs.webkit.org/show_bug.cgi?id=184268
+ <rdar://problem/39144446>
+
+ Reviewed by Chris Dumez.
+
+ The assertion is no longer true after the change, because multiple resources could have same
+ url. Used if condition here to make sure we only delete specified resource.
+
+ No new tests. Updated an existing test to test the stop loading case by not using injected
+ bundle policy: http/tests/multipart/multipart-html.php.
+
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::removeCachedResource):
+
2018-04-10 Zalan Bujtas <[email protected]>
Do not layout images when we only need the overflow information.
Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (230488 => 230489)
--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp 2018-04-10 19:46:40 UTC (rev 230489)
@@ -1257,7 +1257,8 @@
void CachedResourceLoader::removeCachedResource(CachedResource& resource)
{
- ASSERT(!m_documentResources.contains(resource.url()) || m_documentResources.get(resource.url()).get() == &resource);
+ if (m_documentResources.contains(resource.url()) && m_documentResources.get(resource.url()).get() != &resource)
+ return;
m_documentResources.remove(resource.url());
}
Modified: trunk/Source/WebKit/ChangeLog (230488 => 230489)
--- trunk/Source/WebKit/ChangeLog 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/Source/WebKit/ChangeLog 2018-04-10 19:46:40 UTC (rev 230489)
@@ -1,3 +1,19 @@
+2018-04-10 Sihui Liu <[email protected]>
+
+ Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
+ https://bugs.webkit.org/show_bug.cgi?id=184268
+ <rdar://problem/39144446>
+
+ Reviewed by Chris Dumez.
+
+ Webpage for multipart stream responses failed to refresh because content policy was set to
+ be ignore when provisonalDocumentLoader was null and navigation ID could not be retrieved.
+ As loading should not stop in this case, we set navigation ID 0 and still ask for content
+ policy.
+
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
+
2018-04-10 Andy Estes <[email protected]>
[iOS] Use PDFKit to render PDFs in WKWebView
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (230488 => 230489)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2018-04-10 19:45:54 UTC (rev 230488)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2018-04-10 19:46:40 UTC (rev 230489)
@@ -753,14 +753,10 @@
WebCore::Frame* coreFrame = m_frame->coreFrame();
auto* policyDocumentLoader = coreFrame ? coreFrame->loader().provisionalDocumentLoader() : nullptr;
- if (!policyDocumentLoader) {
- function(PolicyAction::Ignore);
- return;
- }
-
+ auto navigationID = policyDocumentLoader ? static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID() : 0;
+
Ref<WebFrame> protector(*m_frame);
uint64_t listenerID = m_frame->setUpPolicyListener(WTFMove(function), WebFrame::ForNavigationAction::No);
- auto navigationID = static_cast<WebDocumentLoader&>(*policyDocumentLoader).navigationID();
if (!webPage->send(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), navigationID, response, request, canShowMIMEType, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))))
m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { });
}