<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[190510] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/190510">190510</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2015-10-02 10:46:25 -0700 (Fri, 02 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>
Source/WebCore:
Reloading without content blockers doesn't apply to resource loads after the main frame finishes
https://bugs.webkit.org/show_bug.cgi?id=149430
rdar://problem/22742222
Reviewed by Geoffrey Garen.
Test: http/tests/contentextensions/disable-blocker.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::userContentExtensionsEnabled):
(WebCore::DocumentLoader::setUserContentExtensionsEnabled):
Store and use the state of whether content blockers are enabled or not on the DocumentLoader
so that it stays constant for a document's entire life. This state comes from the Page when
making the DocumentLoader in WebKit2.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/UserContentController.cpp:
(WebCore::UserContentController::removeAllUserContentExtensions):
(WebCore::UserContentController::processContentExtensionRulesForLoad):
(WebCore::UserContentController::actionsForResourceLoad):
* page/UserContentController.h:
Source/WebKit2:
Reloading without content blockers doesn't apply to resource loads after the main frame finishes
https://bugs.webkit.org/show_bug.cgi?id=149430
rdar://problem/22742222
Reviewed by Geoffrey Garen.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createDocumentLoader):
Copy the state of whether content extensions are disabled from the Page to the DocumentLoader
when making a DocumentLoader.
Tools:
Reloading without content blockers doesn't apply to resource loads after the main frame finishes
https://bugs.webkit.org/show_bug.cgi?id=149430
rdar://problem/22742222
Reviewed by Geoffrey Garen.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaResetStateToConsistentValues):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformConfigureViewForTest):
Test what happens when you disable content blockers from the SPI.
LayoutTests:
Reloading without content blockers doesn’t apply to resource loads after the main frame finishes
https://bugs.webkit.org/show_bug.cgi?id=149430
rdar://problem/22742222
Reviewed by Geoffrey Garen.
* http/tests/contentextensions/disable-blocker-expected.txt: Added.
* http/tests/contentextensions/disable-blocker.html: Added.
* http/tests/contentextensions/disable-blocker.html.json: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoaderh">trunk/Source/WebCore/loader/DocumentLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllercpp">trunk/Source/WebCore/page/UserContentController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllerh">trunk/Source/WebCore/page/UserContentController.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnercocoaTestControllerCocoamm">trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacTestControllerMacmm">trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscontentextensionsdisableblockerexpectedtxt">trunk/LayoutTests/http/tests/contentextensions/disable-blocker-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsdisableblockerhtml">trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsdisableblockerhtmljson">trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html.json</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/LayoutTests/ChangeLog        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-10-02 Alex Christensen <achristensen@webkit.org>
+
+ Reloading without content blockers doesn’t apply to resource loads after the main frame finishes
+ https://bugs.webkit.org/show_bug.cgi?id=149430
+ rdar://problem/22742222
+
+ Reviewed by Geoffrey Garen.
+
+ * http/tests/contentextensions/disable-blocker-expected.txt: Added.
+ * http/tests/contentextensions/disable-blocker.html: Added.
+ * http/tests/contentextensions/disable-blocker.html.json: Added.
+
</ins><span class="cx"> 2015-10-02 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> popstate is fired at the wrong time on load
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsdisableblockerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/disable-blocker-expected.txt (0 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/disable-blocker-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/disable-blocker-expected.txt        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+CONSOLE MESSAGE: line 12: status: 0, readyState:1, responseText:
+CONSOLE MESSAGE: line 12: status: 200, readyState:2, responseText:
+CONSOLE MESSAGE: line 12: status: 200, readyState:3, responseText:
+CONSOLE MESSAGE: line 12: status: 200, readyState:4, responseText: This page should load.
+<script>
+ console.log("This page should load.");
+</script>
+
+This page should load successfully. The content blocker is disabled in WebKitTestRunner before loading the page.
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsdisableblockerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html (0 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html         (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+<head>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+function sendRequest()
+{
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function() {
+ console.log("status: " + xhr.status + ", readyState:" + xhr.readyState + ", responseText: " + xhr.responseText);
+ if (xhr.readyState == 4) {
+ testRunner.notifyDone();
+ }
+ }
+
+ xhr.open("GET", "resources/should-load.html", true);
+        xhr.send();
+}
+</script>
+</head>
+<body onload="sendRequest()">
+This page should load successfully. The content blocker is disabled in WebKitTestRunner before loading the page.
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsdisableblockerhtmljson"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html.json (0 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html.json         (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/disable-blocker.html.json        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+[
+ {
+ "action": {
+ "type": "block"
+ },
+ "trigger": {
+ "url-filter": ".*"
+ }
+ }
+]
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/ChangeLog        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-10-02 Alex Christensen <achristensen@webkit.org>
+
+ Reloading without content blockers doesn't apply to resource loads after the main frame finishes
+ https://bugs.webkit.org/show_bug.cgi?id=149430
+ rdar://problem/22742222
+
+ Reviewed by Geoffrey Garen.
+
+ Test: http/tests/contentextensions/disable-blocker.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::loadResource):
+ * loader/DocumentLoader.h:
+ (WebCore::DocumentLoader::userContentExtensionsEnabled):
+ (WebCore::DocumentLoader::setUserContentExtensionsEnabled):
+ Store and use the state of whether content blockers are enabled or not on the DocumentLoader
+ so that it stays constant for a document's entire life. This state comes from the Page when
+ making the DocumentLoader in WebKit2.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadResourceSynchronously):
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::willSendRequestInternal):
+ * loader/cache/CachedResourceLoader.cpp:
+ (WebCore::CachedResourceLoader::requestResource):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::open):
+ * page/UserContentController.cpp:
+ (WebCore::UserContentController::removeAllUserContentExtensions):
+ (WebCore::UserContentController::processContentExtensionRulesForLoad):
+ (WebCore::UserContentController::actionsForResourceLoad):
+ * page/UserContentController.h:
+
</ins><span class="cx"> 2015-10-02 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> popstate is fired at the wrong time on load
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -1226,7 +1226,7 @@
</span><span class="cx"> DocumentLoader* documentLoader = frame->loader().documentLoader();
</span><span class="cx">
</span><span class="cx"> if (page->userContentController() && documentLoader)
</span><del>- page->userContentController()->processContentExtensionRulesForLoad(*page, request, ResourceType::Media, *documentLoader);
</del><ins>+ page->userContentController()->processContentExtensionRulesForLoad(request, ResourceType::Media, *documentLoader);
</ins><span class="cx">
</span><span class="cx"> if (request.isNull()) {
</span><span class="cx"> mediaLoadingFailed(MediaPlayer::FormatError);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.h (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.h        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/loader/DocumentLoader.h        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -227,6 +227,9 @@
</span><span class="cx"> void stopLoadingPlugIns();
</span><span class="cx"> void stopLoadingSubresources();
</span><span class="cx">
</span><ins>+ bool userContentExtensionsEnabled() const { return m_userContentExtensionsEnabled; }
+ void setUserContentExtensionsEnabled(bool enabled) { m_userContentExtensionsEnabled = enabled; }
+
</ins><span class="cx"> void addSubresourceLoader(ResourceLoader*);
</span><span class="cx"> void removeSubresourceLoader(ResourceLoader*);
</span><span class="cx"> void addPlugInStreamLoader(ResourceLoader&);
</span><span class="lines">@@ -451,6 +454,7 @@
</span><span class="cx"> HashMap<String, RefPtr<StyleSheetContents>> m_pendingNamedContentExtensionStyleSheets;
</span><span class="cx"> HashMap<String, Vector<std::pair<String, uint32_t>>> m_pendingContentExtensionDisplayNoneSelectors;
</span><span class="cx"> #endif
</span><ins>+ bool m_userContentExtensionsEnabled { true };
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> bool m_hasEverBeenAttached { false };
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -2710,7 +2710,7 @@
</span><span class="cx"> if (m_documentLoader) {
</span><span class="cx"> if (auto* page = m_frame.page()) {
</span><span class="cx"> if (auto* controller = page->userContentController())
</span><del>- controller->processContentExtensionRulesForLoad(*page, newRequest, ResourceType::Raw, *m_documentLoader);
</del><ins>+ controller->processContentExtensionRulesForLoad(newRequest, ResourceType::Raw, *m_documentLoader);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -342,7 +342,7 @@
</span><span class="cx"> if (page && m_documentLoader) {
</span><span class="cx"> auto* userContentController = page->userContentController();
</span><span class="cx"> if (userContentController)
</span><del>- userContentController->processContentExtensionRulesForLoad(*page, request, m_resourceType, *m_documentLoader);
</del><ins>+ userContentController->processContentExtensionRulesForLoad(request, m_resourceType, *m_documentLoader);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx"> if (frame() && frame()->mainFrame().page() && frame()->mainFrame().page()->userContentController() && m_documentLoader)
</span><del>- frame()->mainFrame().page()->userContentController()->processContentExtensionRulesForLoad(*frame()->mainFrame().page(), request.mutableResourceRequest(), toResourceType(type), *m_documentLoader);
</del><ins>+ frame()->mainFrame().page()->userContentController()->processContentExtensionRulesForLoad(request.mutableResourceRequest(), toResourceType(type), *m_documentLoader);
</ins><span class="cx">
</span><span class="cx"> if (request.mutableResourceRequest().isNull())
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -2144,9 +2144,10 @@
</span><span class="cx"> if (firstFrame->document()
</span><span class="cx"> && firstFrame->mainFrame().page()
</span><span class="cx"> && firstFrame->mainFrame().page()->userContentController()
</span><del>- && firstFrame->mainFrame().document()) {
</del><ins>+ && firstFrame->mainFrame().document()
+ && firstFrame->mainFrame().document()->loader()) {
</ins><span class="cx"> ResourceLoadInfo resourceLoadInfo = {firstFrame->document()->completeURL(urlString), firstFrame->mainFrame().document()->url(), ResourceType::Popup};
</span><del>- Vector<ContentExtensions::Action> actions = firstFrame->mainFrame().page()->userContentController()->actionsForResourceLoad(*firstFrame->mainFrame().page(), resourceLoadInfo);
</del><ins>+ Vector<ContentExtensions::Action> actions = firstFrame->mainFrame().page()->userContentController()->actionsForResourceLoad(resourceLoadInfo, *firstFrame->mainFrame().document()->loader());
</ins><span class="cx"> for (const ContentExtensions::Action& action : actions) {
</span><span class="cx"> if (action.type() == ContentExtensions::ActionType::BlockLoad)
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "DOMWrapperWorld.h"
</span><span class="cx"> #include "Document.h"
</span><ins>+#include "DocumentLoader.h"
</ins><span class="cx"> #include "ExtensionStyleSheets.h"
</span><span class="cx"> #include "MainFrame.h"
</span><span class="cx"> #include "Page.h"
</span><span class="lines">@@ -207,23 +208,23 @@
</span><span class="cx"> m_contentExtensionBackend->removeAllContentExtensions();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UserContentController::processContentExtensionRulesForLoad(Page& page, ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
</del><ins>+void UserContentController::processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_contentExtensionBackend)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!page.userContentExtensionsEnabled())
</del><ins>+ if (!initiatingDocumentLoader.userContentExtensionsEnabled())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_contentExtensionBackend->processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Vector<ContentExtensions::Action> UserContentController::actionsForResourceLoad(Page& page, const ResourceLoadInfo& resourceLoadInfo)
</del><ins>+Vector<ContentExtensions::Action> UserContentController::actionsForResourceLoad(const ResourceLoadInfo& resourceLoadInfo, DocumentLoader& initiatingDocumentLoader)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_contentExtensionBackend)
</span><span class="cx"> return Vector<ContentExtensions::Action>();
</span><span class="cx">
</span><del>- if (!page.userContentExtensionsEnabled())
</del><ins>+ if (!initiatingDocumentLoader.userContentExtensionsEnabled())
</ins><span class="cx"> return Vector<ContentExtensions::Action>();
</span><span class="cx">
</span><span class="cx"> return m_contentExtensionBackend->actionsForResourceLoad(resourceLoadInfo);
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.h (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.h        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebCore/page/UserContentController.h        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -92,8 +92,8 @@
</span><span class="cx"> WEBCORE_EXPORT void removeUserContentExtension(const String& name);
</span><span class="cx"> WEBCORE_EXPORT void removeAllUserContentExtensions();
</span><span class="cx">
</span><del>- void processContentExtensionRulesForLoad(Page&, ResourceRequest&, ResourceType, DocumentLoader& initiatingDocumentLoader);
- Vector<ContentExtensions::Action> actionsForResourceLoad(Page&, const ResourceLoadInfo&);
</del><ins>+ void processContentExtensionRulesForLoad(ResourceRequest&, ResourceType, DocumentLoader& initiatingDocumentLoader);
+ Vector<ContentExtensions::Action> actionsForResourceLoad(const ResourceLoadInfo&, DocumentLoader& initiatingDocumentLoader);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-10-02 Alex Christensen <achristensen@webkit.org>
+
+ Reloading without content blockers doesn't apply to resource loads after the main frame finishes
+ https://bugs.webkit.org/show_bug.cgi?id=149430
+ rdar://problem/22742222
+
+ Reviewed by Geoffrey Garen.
+
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::createDocumentLoader):
+ Copy the state of whether content extensions are disabled from the Page to the DocumentLoader
+ when making a DocumentLoader.
+
</ins><span class="cx"> 2015-10-02 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> popstate is fired at the wrong time on load
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -4896,9 +4896,13 @@
</span><span class="cx"> {
</span><span class="cx"> Ref<WebDocumentLoader> documentLoader = WebDocumentLoader::create(request, substituteData);
</span><span class="cx">
</span><del>- if (m_pendingNavigationID && frame.isMainFrame()) {
- documentLoader->setNavigationID(m_pendingNavigationID);
- m_pendingNavigationID = 0;
</del><ins>+ if (frame.isMainFrame()) {
+ if (m_pendingNavigationID) {
+ documentLoader->setNavigationID(m_pendingNavigationID);
+ m_pendingNavigationID = 0;
+ }
+ if (frame.page())
+ documentLoader->setUserContentExtensionsEnabled(frame.page()->userContentExtensionsEnabled());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return WTF::move(documentLoader);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Tools/ChangeLog        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-02 Alex Christensen <achristensen@webkit.org>
+
+ Reloading without content blockers doesn't apply to resource loads after the main frame finishes
+ https://bugs.webkit.org/show_bug.cgi?id=149430
+ rdar://problem/22742222
+
+ Reviewed by Geoffrey Garen.
+
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::cocoaResetStateToConsistentValues):
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::platformConfigureViewForTest):
+ Test what happens when you disable content blockers from the SPI.
+
</ins><span class="cx"> 2015-10-01 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [Win] Unreviewed build fix for run-api-tests
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnercocoaTestControllerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #import <WebKit/WKWebView.h>
</span><span class="cx"> #import <WebKit/WKWebViewConfiguration.h>
</span><span class="cx"> #import <WebKit/WKWebViewConfigurationPrivate.h>
</span><ins>+#import <WebKit/WKWebViewPrivate.h>
</ins><span class="cx"> #import <WebKit/_WKProcessPoolConfiguration.h>
</span><span class="cx"> #import <WebKit/_WKUserContentExtensionStore.h>
</span><span class="cx"> #import <WebKit/_WKUserContentExtensionStorePrivate.h>
</span><span class="lines">@@ -119,8 +120,10 @@
</span><span class="cx"> platformRunUntil(doneRemoving, 0);
</span><span class="cx"> [[_WKUserContentExtensionStore defaultStore] _removeAllContentExtensions];
</span><span class="cx">
</span><del>- if (PlatformWebView* webView = mainWebView())
</del><ins>+ if (PlatformWebView* webView = mainWebView()) {
</ins><span class="cx"> [webView->platformView().configuration.userContentController _removeAllUserContentFilters];
</span><ins>+ webView->platformView()._userContentExtensionsEnabled = true;
+ }
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacTestControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (190509 => 190510)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-10-02 17:30:02 UTC (rev 190509)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2015-10-02 17:46:25 UTC (rev 190510)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #import <WebKit/WKWebView.h>
</span><span class="cx"> #import <WebKit/WKWebViewConfiguration.h>
</span><span class="cx"> #import <WebKit/WKWebViewConfigurationPrivate.h>
</span><ins>+#import <WebKit/WKWebViewPrivate.h>
</ins><span class="cx"> #import <WebKit/_WKUserContentExtensionStore.h>
</span><span class="cx"> #import <WebKit/_WKUserContentExtensionStorePrivate.h>
</span><span class="cx"> #import <mach-o/dyld.h>
</span><span class="lines">@@ -122,6 +123,11 @@
</span><span class="cx"> doneCompiling = true;
</span><span class="cx"> }];
</span><span class="cx"> platformRunUntil(doneCompiling, 0);
</span><ins>+
+ // This is for http/tests/contentextensions/disable-blocker.html
+ if (!test.urlContains("disable-blocker"))
+ return;
+ mainWebView()->platformView()._userContentExtensionsEnabled = false;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>