Skip to content
  • akling@apple.com's avatar
    REGRESSION(r150867): FrameView auto-sizing + delegate denied image load may... · d483f707
    akling@apple.com authored
    REGRESSION(r150867): FrameView auto-sizing + delegate denied image load may cause StyleResolver to re-enter itself.
    <rdar://problem/14324895>
    <http://webkit.org/b/119023>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    The bug happened when FrameView::autoSizeIfEnabled() was getting called below FrameLoader::checkCompleted()
    triggered by an incorrect loadDone() callback originating in SubresourceLoader::didCancel().
    
    * css/StyleResolver.cpp:
    (WebCore::StyleResolver::loadPendingResources):
    
        Add an assertion that this function is not getting re-entered. If a similar bug occurs
        in the future, this will help the lucky person debugging.
    
    * loader/SubresourceLoader.cpp:
    (WebCore::SubresourceLoader::didCancel):
    
        Don't notifyDone() if the SubresourceLoader is in Uninitialized state.
    
    Tools:
    
    Add a test for this rather specific problem.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm: Added.
    (TestWebKitAPI::TEST):
    * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp: Added.
    (TestWebKitAPI::DenyWillSendRequestTest::DenyWillSendRequestTest):
    (TestWebKitAPI::DenyWillSendRequestTest::willSendRequestForFrame):
    (TestWebKitAPI::DenyWillSendRequestTest::didCreatePage):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d483f707