Title: [191460] branches/safari-601.1.46-branch/Source/WebCore
Revision
191460
Author
matthew_han...@apple.com
Date
2015-10-22 11:36:01 -0700 (Thu, 22 Oct 2015)

Log Message

Merge r191223. rdar://problem/22900764

Modified Paths

Diff

Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (191459 => 191460)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-22 18:35:55 UTC (rev 191459)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2015-10-22 18:36:01 UTC (rev 191460)
@@ -1,5 +1,27 @@
 2015-10-20  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r191223. rdar://problem/22900764
+
+    2015-10-16  Alex Christensen  <achristen...@webkit.org>
+
+            Disabled content blockers should not block any loads
+            https://bugs.webkit.org/show_bug.cgi?id=150261
+
+            Reviewed by Brady Eidson.
+
+            This fix was tested manually by reloading without content blockers
+            on websites with iframes and content blockers that block the contents of the iframes.
+
+            * page/UserContentController.cpp:
+            (WebCore::UserContentController::removeAllUserContentExtensions):
+            (WebCore::contentExtensionsEnabled):
+            (WebCore::UserContentController::processContentExtensionRulesForLoad):
+            (WebCore::UserContentController::actionsForResourceLoad):
+            Check the DocumentLoader of the main frame when checking if content extensions are disabled,
+            because that is the DocumentLoader that has the flag from reloading without content blockers.
+
+2015-10-20  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r191063. rdar://problem/22900764
 
     2015-10-14  Alex Christensen  <achristen...@webkit.org>

Modified: branches/safari-601.1.46-branch/Source/WebCore/page/UserContentController.cpp (191459 => 191460)


--- branches/safari-601.1.46-branch/Source/WebCore/page/UserContentController.cpp	2015-10-22 18:35:55 UTC (rev 191459)
+++ branches/safari-601.1.46-branch/Source/WebCore/page/UserContentController.cpp	2015-10-22 18:36:01 UTC (rev 191460)
@@ -205,12 +205,24 @@
     m_contentExtensionBackend->removeAllContentExtensions();
 }
 
+static bool contentExtensionsEnabled(const DocumentLoader& documentLoader)
+{
+    if (auto frame = documentLoader.frame()) {
+        if (frame->isMainFrame())
+            return documentLoader.userContentExtensionsEnabled();
+        if (auto mainDocumentLoader = frame->mainFrame().loader().documentLoader())
+            return mainDocumentLoader->userContentExtensionsEnabled();
+    }
+
+    return true;
+}
+
 void UserContentController::processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
 {
     if (!m_contentExtensionBackend)
         return;
 
-    if (!initiatingDocumentLoader.userContentExtensionsEnabled())
+    if (!contentExtensionsEnabled(initiatingDocumentLoader))
         return;
 
     m_contentExtensionBackend->processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
@@ -221,7 +233,7 @@
     if (!m_contentExtensionBackend)
         return Vector<ContentExtensions::Action>();
     
-    if (!initiatingDocumentLoader.userContentExtensionsEnabled())
+    if (!contentExtensionsEnabled(initiatingDocumentLoader))
         return Vector<ContentExtensions::Action>();
 
     return m_contentExtensionBackend->actionsForResourceLoad(resourceLoadInfo);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to