<!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  &lt;achristensen@webkit.org&gt;
+
+        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  &lt;graouts@apple.com&gt;
</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.
+&lt;script&gt;
+    console.log(&quot;This page should load.&quot;);
+&lt;/script&gt;
+
+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>+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+function sendRequest()
+{
+    var xhr = new XMLHttpRequest();
+    xhr.onreadystatechange = function() {
+        console.log(&quot;status: &quot; + xhr.status + &quot;, readyState:&quot; + xhr.readyState + &quot;, responseText: &quot; + xhr.responseText);
+        if (xhr.readyState == 4) {
+            testRunner.notifyDone();
+        }
+    }
+    
+    xhr.open(&quot;GET&quot;, &quot;resources/should-load.html&quot;, true);
+        xhr.send();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;sendRequest()&quot;&gt;
+This page should load successfully.  The content blocker is disabled in WebKitTestRunner before loading the page.
+&lt;/body&gt;
</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>+[
+    {
+        &quot;action&quot;: {
+            &quot;type&quot;: &quot;block&quot;
+        },
+        &quot;trigger&quot;: {
+            &quot;url-filter&quot;: &quot;.*&quot;
+        }
+    }
+]
</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  &lt;achristensen@webkit.org&gt;
+
+        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  &lt;graouts@apple.com&gt;
</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-&gt;loader().documentLoader();
</span><span class="cx"> 
</span><span class="cx">     if (page-&gt;userContentController() &amp;&amp; documentLoader)
</span><del>-        page-&gt;userContentController()-&gt;processContentExtensionRulesForLoad(*page, request, ResourceType::Media, *documentLoader);
</del><ins>+        page-&gt;userContentController()-&gt;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&amp;);
</span><span class="lines">@@ -451,6 +454,7 @@
</span><span class="cx">         HashMap&lt;String, RefPtr&lt;StyleSheetContents&gt;&gt; m_pendingNamedContentExtensionStyleSheets;
</span><span class="cx">         HashMap&lt;String, Vector&lt;std::pair&lt;String, uint32_t&gt;&gt;&gt; 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-&gt;userContentController())
</span><del>-                    controller-&gt;processContentExtensionRulesForLoad(*page, newRequest, ResourceType::Raw, *m_documentLoader);
</del><ins>+                    controller-&gt;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 &amp;&amp; m_documentLoader) {
</span><span class="cx">             auto* userContentController = page-&gt;userContentController();
</span><span class="cx">             if (userContentController)
</span><del>-                userContentController-&gt;processContentExtensionRulesForLoad(*page, request, m_resourceType, *m_documentLoader);
</del><ins>+                userContentController-&gt;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() &amp;&amp; frame()-&gt;mainFrame().page() &amp;&amp; frame()-&gt;mainFrame().page()-&gt;userContentController() &amp;&amp; m_documentLoader)
</span><del>-        frame()-&gt;mainFrame().page()-&gt;userContentController()-&gt;processContentExtensionRulesForLoad(*frame()-&gt;mainFrame().page(), request.mutableResourceRequest(), toResourceType(type), *m_documentLoader);
</del><ins>+        frame()-&gt;mainFrame().page()-&gt;userContentController()-&gt;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-&gt;document()
</span><span class="cx">         &amp;&amp; firstFrame-&gt;mainFrame().page()
</span><span class="cx">         &amp;&amp; firstFrame-&gt;mainFrame().page()-&gt;userContentController()
</span><del>-        &amp;&amp; firstFrame-&gt;mainFrame().document()) {
</del><ins>+        &amp;&amp; firstFrame-&gt;mainFrame().document()
+        &amp;&amp; firstFrame-&gt;mainFrame().document()-&gt;loader()) {
</ins><span class="cx">         ResourceLoadInfo resourceLoadInfo = {firstFrame-&gt;document()-&gt;completeURL(urlString), firstFrame-&gt;mainFrame().document()-&gt;url(), ResourceType::Popup};
</span><del>-        Vector&lt;ContentExtensions::Action&gt; actions = firstFrame-&gt;mainFrame().page()-&gt;userContentController()-&gt;actionsForResourceLoad(*firstFrame-&gt;mainFrame().page(), resourceLoadInfo);
</del><ins>+        Vector&lt;ContentExtensions::Action&gt; actions = firstFrame-&gt;mainFrame().page()-&gt;userContentController()-&gt;actionsForResourceLoad(resourceLoadInfo, *firstFrame-&gt;mainFrame().document()-&gt;loader());
</ins><span class="cx">         for (const ContentExtensions::Action&amp; 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 &quot;DOMWrapperWorld.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;DocumentLoader.h&quot;
</ins><span class="cx"> #include &quot;ExtensionStyleSheets.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="lines">@@ -207,23 +208,23 @@
</span><span class="cx">     m_contentExtensionBackend-&gt;removeAllContentExtensions();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void UserContentController::processContentExtensionRulesForLoad(Page&amp; page, ResourceRequest&amp; request, ResourceType resourceType, DocumentLoader&amp; initiatingDocumentLoader)
</del><ins>+void UserContentController::processContentExtensionRulesForLoad(ResourceRequest&amp; request, ResourceType resourceType, DocumentLoader&amp; 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-&gt;processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;ContentExtensions::Action&gt; UserContentController::actionsForResourceLoad(Page&amp; page, const ResourceLoadInfo&amp; resourceLoadInfo)
</del><ins>+Vector&lt;ContentExtensions::Action&gt; UserContentController::actionsForResourceLoad(const ResourceLoadInfo&amp; resourceLoadInfo, DocumentLoader&amp; initiatingDocumentLoader)
</ins><span class="cx"> {
</span><span class="cx">     if (!m_contentExtensionBackend)
</span><span class="cx">         return Vector&lt;ContentExtensions::Action&gt;();
</span><span class="cx">     
</span><del>-    if (!page.userContentExtensionsEnabled())
</del><ins>+    if (!initiatingDocumentLoader.userContentExtensionsEnabled())
</ins><span class="cx">         return Vector&lt;ContentExtensions::Action&gt;();
</span><span class="cx"> 
</span><span class="cx">     return m_contentExtensionBackend-&gt;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&amp; name);
</span><span class="cx">     WEBCORE_EXPORT void removeAllUserContentExtensions();
</span><span class="cx"> 
</span><del>-    void processContentExtensionRulesForLoad(Page&amp;, ResourceRequest&amp;, ResourceType, DocumentLoader&amp; initiatingDocumentLoader);
-    Vector&lt;ContentExtensions::Action&gt; actionsForResourceLoad(Page&amp;, const ResourceLoadInfo&amp;);
</del><ins>+    void processContentExtensionRulesForLoad(ResourceRequest&amp;, ResourceType, DocumentLoader&amp; initiatingDocumentLoader);
+    Vector&lt;ContentExtensions::Action&gt; actionsForResourceLoad(const ResourceLoadInfo&amp;, DocumentLoader&amp; 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  &lt;achristensen@webkit.org&gt;
+
+        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  &lt;graouts@apple.com&gt;
</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&lt;WebDocumentLoader&gt; documentLoader = WebDocumentLoader::create(request, substituteData);
</span><span class="cx"> 
</span><del>-    if (m_pendingNavigationID &amp;&amp; frame.isMainFrame()) {
-        documentLoader-&gt;setNavigationID(m_pendingNavigationID);
-        m_pendingNavigationID = 0;
</del><ins>+    if (frame.isMainFrame()) {
+        if (m_pendingNavigationID) {
+            documentLoader-&gt;setNavigationID(m_pendingNavigationID);
+            m_pendingNavigationID = 0;
+        }
+        if (frame.page())
+            documentLoader-&gt;setUserContentExtensionsEnabled(frame.page()-&gt;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  &lt;achristensen@webkit.org&gt;
+
+        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  &lt;bfulgham@apple.com&gt;
</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 &lt;WebKit/WKWebView.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKWebViewConfiguration.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
</span><ins>+#import &lt;WebKit/WKWebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/_WKProcessPoolConfiguration.h&gt;
</span><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStore.h&gt;
</span><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStorePrivate.h&gt;
</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-&gt;platformView().configuration.userContentController _removeAllUserContentFilters];
</span><ins>+        webView-&gt;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 &lt;WebKit/WKWebView.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKWebViewConfiguration.h&gt;
</span><span class="cx"> #import &lt;WebKit/WKWebViewConfigurationPrivate.h&gt;
</span><ins>+#import &lt;WebKit/WKWebViewPrivate.h&gt;
</ins><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStore.h&gt;
</span><span class="cx"> #import &lt;WebKit/_WKUserContentExtensionStorePrivate.h&gt;
</span><span class="cx"> #import &lt;mach-o/dyld.h&gt;
</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(&quot;disable-blocker&quot;))
+        return;
+    mainWebView()-&gt;platformView()._userContentExtensionsEnabled = false;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>