Changeset 191460 in webkit


Ignore:
Timestamp:
Oct 22, 2015 11:36:01 AM (9 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r191223. rdar://problem/22900764

Location:
branches/safari-601.1.46-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-601.1.46-branch/Source/WebCore/ChangeLog

    r191459 r191460  
     12015-10-20  Matthew Hanson  <matthew_hanson@apple.com>
     2
     3        Merge r191223. rdar://problem/22900764
     4
     5    2015-10-16  Alex Christensen  <achristensen@webkit.org>
     6
     7            Disabled content blockers should not block any loads
     8            https://bugs.webkit.org/show_bug.cgi?id=150261
     9
     10            Reviewed by Brady Eidson.
     11
     12            This fix was tested manually by reloading without content blockers
     13            on websites with iframes and content blockers that block the contents of the iframes.
     14
     15            * page/UserContentController.cpp:
     16            (WebCore::UserContentController::removeAllUserContentExtensions):
     17            (WebCore::contentExtensionsEnabled):
     18            (WebCore::UserContentController::processContentExtensionRulesForLoad):
     19            (WebCore::UserContentController::actionsForResourceLoad):
     20            Check the DocumentLoader of the main frame when checking if content extensions are disabled,
     21            because that is the DocumentLoader that has the flag from reloading without content blockers.
     22
    1232015-10-20  Matthew Hanson  <matthew_hanson@apple.com>
    224
  • branches/safari-601.1.46-branch/Source/WebCore/page/UserContentController.cpp

    r191458 r191460  
    206206}
    207207
     208static bool contentExtensionsEnabled(const DocumentLoader& documentLoader)
     209{
     210    if (auto frame = documentLoader.frame()) {
     211        if (frame->isMainFrame())
     212            return documentLoader.userContentExtensionsEnabled();
     213        if (auto mainDocumentLoader = frame->mainFrame().loader().documentLoader())
     214            return mainDocumentLoader->userContentExtensionsEnabled();
     215    }
     216
     217    return true;
     218}
     219
    208220void UserContentController::processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
    209221{
     
    211223        return;
    212224
    213     if (!initiatingDocumentLoader.userContentExtensionsEnabled())
     225    if (!contentExtensionsEnabled(initiatingDocumentLoader))
    214226        return;
    215227
     
    222234        return Vector<ContentExtensions::Action>();
    223235   
    224     if (!initiatingDocumentLoader.userContentExtensionsEnabled())
     236    if (!contentExtensionsEnabled(initiatingDocumentLoader))
    225237        return Vector<ContentExtensions::Action>();
    226238
Note: See TracChangeset for help on using the changeset viewer.