Changeset 228461 in webkit


Ignore:
Timestamp:
Feb 13, 2018 10:57:35 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r228430. rdar://problem/37518683

Location:
branches/safari-605-branch
Files:
1 added
5 edited

Legend:

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

    r228450 r228461  
     12018-02-13  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228430. rdar://problem/37518683
     4
     5    2018-02-13  Chris Dumez  <cdumez@apple.com>
     6
     7            REGRESSION (r228299): Broke reader mode in Safari
     8            https://bugs.webkit.org/show_bug.cgi?id=182697
     9            <rdar://problem/37399012>
     10
     11            Reviewed by Ryosuke Niwa.
     12
     13            Rework the fix for r228299 to be more targeted. I moved the policy check
     14            cencelation from FrameLoader::stopLoading() to NavigationScheduler::schedule()
     15            when a pending load is cancelled by another load. I have verified that the
     16            sites fixed by r228299 still work with this more limited change. However,
     17            reader mode is now working again.
     18
     19            The issue seems to be that we tell CFNetwork to continue with the load after
     20            receiving the response, even if the client has not responded to the
     21            decidePolicyForNavigationResponse delegate yet. As a result, CFNetwork sends
     22            us the resource data and we may commit the provisional load before receiving
     23            the policy response from the client. When the provisional load is committed,
     24            we call FrameLoader::stopLoading() which after r228299 cancelled pending
     25            policy checks. Because we did not wait for the policy check response to
     26            commit the load, we would cancel it which would make the load fail.
     27
     28            The real fix here would be to make not tell CFNetwork to continue until after
     29            we've received the policy delegate response. However, this is a larger and
     30            riskier change at this point. I will follow-up on this issue.
     31
     32            Covered by new API test.
     33
     34            * loader/FrameLoader.cpp:
     35            (WebCore::FrameLoader::stopLoading):
     36            * loader/NavigationScheduler.cpp:
     37            (WebCore::NavigationScheduler::schedule):
     38
    1392018-02-13  Jason Marcell  <jmarcell@apple.com>
    240
  • branches/safari-605-branch/Source/WebCore/loader/FrameLoader.cpp

    r228447 r228461  
    489489    }
    490490
    491     policyChecker().stopCheck();
    492 
    493491    // FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
    494492    m_frame.navigationScheduler().cancel();
  • branches/safari-605-branch/Source/WebCore/loader/NavigationScheduler.cpp

    r226894 r228461  
    5151#include "NavigationDisabler.h"
    5252#include "Page.h"
     53#include "PolicyChecker.h"
    5354#include "ScriptController.h"
    5455#include "UserGestureIndicator.h"
     
    521522        if (DocumentLoader* provisionalDocumentLoader = m_frame.loader().provisionalDocumentLoader())
    522523            provisionalDocumentLoader->stopLoading();
     524        m_frame.loader().policyChecker().stopCheck();
    523525        m_frame.loader().stopLoading(UnloadEventPolicyUnloadAndPageHide);
    524526    }
  • branches/safari-605-branch/Tools/ChangeLog

    r228380 r228461  
     12018-02-13  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r228430. rdar://problem/37518683
     4
     5    2018-02-13  Chris Dumez  <cdumez@apple.com>
     6
     7            REGRESSION (r228299): Broke reader mode in Safari
     8            https://bugs.webkit.org/show_bug.cgi?id=182697
     9            <rdar://problem/37399012>
     10
     11            Reviewed by Ryosuke Niwa.
     12
     13            Add API test coverage for responding asynchronously to the decidePolicyForNavigationResponse
     14            delegate.
     15
     16            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     17            * TestWebKitAPI/Tests/WebKitCocoa/AsyncPolicyForNavigationResponse.mm: Added.
     18            (-[TestAsyncNavigationDelegate webView:didFinishNavigation:]):
     19            (-[TestAsyncNavigationDelegate webView:didFailNavigation:withError:]):
     20            (-[TestAsyncNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
     21            (-[TestAsyncNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
     22            (-[TestAsyncNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
     23            (TestWebKitAPI::TEST):
     24
    1252018-02-12  Jason Marcell  <jmarcell@apple.com>
    226
  • branches/safari-605-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r228360 r228461  
    531531                7CEFA9661AC0B9E200B910FD /* _WKUserContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CEFA9641AC0B9E200B910FD /* _WKUserContentExtensionStore.mm */; };
    532532                7CFBCAE51743238F00B2BFCF /* WillLoad_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */; };
     533                834138C7203261CA00F26960 /* AsyncPolicyForNavigationResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 834138C6203261B900F26960 /* AsyncPolicyForNavigationResponse.mm */; };
    533534                8349D3C21DB96DDE004A9F65 /* ContextMenuDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8349D3C11DB96DDA004A9F65 /* ContextMenuDownload.mm */; };
    534535                8349D3C41DB9728E004A9F65 /* link-with-download-attribute.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 8349D3C31DB9724F004A9F65 /* link-with-download-attribute.html */; };
     
    15181519                7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WillLoad_Bundle.cpp; sourceTree = "<group>"; };
    15191520                81B50192140F232300D9EB58 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringBuilder.cpp; sourceTree = "<group>"; };
     1521                834138C6203261B900F26960 /* AsyncPolicyForNavigationResponse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AsyncPolicyForNavigationResponse.mm; sourceTree = "<group>"; };
    15201522                8349D3C11DB96DDA004A9F65 /* ContextMenuDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContextMenuDownload.mm; sourceTree = "<group>"; };
    15211523                8349D3C31DB9724F004A9F65 /* link-with-download-attribute.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "link-with-download-attribute.html"; sourceTree = "<group>"; };
     
    20542056                                2DE71AFD1D49C0BD00904094 /* AnimatedResize.mm */,
    20552057                                63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */,
     2058                                834138C6203261B900F26960 /* AsyncPolicyForNavigationResponse.mm */,
    20562059                                754CEC801F6722DC00D0039A /* AutoFillAvailable.mm */,
    20572060                                2DD355351BD08378005DF4A7 /* AutoLayoutIntegration.mm */,
     
    33393342                                63F668221F97F7F90032EE51 /* ApplicationManifest.mm in Sources */,
    33403343                                6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */,
     3344                                834138C7203261CA00F26960 /* AsyncPolicyForNavigationResponse.mm in Sources */,
    33413345                                7CCE7EB41A411A7E00447C4C /* AttributedString.mm in Sources */,
    33423346                                CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.