Changeset 228922 in webkit
- Timestamp:
- Feb 22, 2018 10:29:26 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r228921 r228922 1 2018-02-22 Chris Dumez <cdumez@apple.com> 2 3 Document.open() cancels existing provisional load but not navigation policy check 4 https://bugs.webkit.org/show_bug.cgi?id=183012 5 <rdar://problem/37755831> 6 7 Reviewed by Alex Christensen. 8 9 Add layout test coverage. 10 11 * fast/dom/Document/open-with-pending-load-async-policy-expected.txt: Added. 12 * fast/dom/Document/open-with-pending-load-async-policy.html: Added. 13 1 14 2018-02-22 Matt Lewis <jlewis3@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r228919 r228922 1 2018-02-22 Chris Dumez <cdumez@apple.com> 2 3 Document.open() cancels existing provisional load but not navigation policy check 4 https://bugs.webkit.org/show_bug.cgi?id=183012 5 <rdar://problem/37755831> 6 7 Reviewed by Alex Christensen. 8 9 Test: fast/dom/Document/open-with-pending-load-async-policy.html 10 11 * dom/Document.cpp: 12 (WebCore::Document::open): 13 The existing code was calling FrameLoader::stopAllLoaders() when the loader's state 14 is FrameStateProvisional. The issue is that the FrameLoader's state only gets set 15 to FrameStateProvisional after the policy decision for the navigation is made. 16 This means that we fail to cancel a pending load if is still in the policy decision 17 stage, which can happen when the policy decision is made asynchronously. We now 18 also cancel such pending navigation policy checks as well. 19 20 * loader/PolicyChecker.cpp: 21 (WebCore::PolicyChecker::checkNavigationPolicy): 22 Make sure the m_delegateIsDecidingNavigationPolicy flag gets reset inside the 23 lambda. Otherwise, it gets reset too early when the policy decision is made 24 asynchronously. 25 1 26 2018-02-22 Youenn Fablet <youenn@apple.com> 2 27 -
trunk/Source/WebCore/dom/Document.cpp
r228889 r228922 143 143 #include "PluginDocument.h" 144 144 #include "PointerLockController.h" 145 #include "PolicyChecker.h" 145 146 #include "PopStateEvent.h" 146 147 #include "ProcessingInstruction.h" … … 2619 2620 } 2620 2621 2622 if (m_frame->loader().policyChecker().delegateIsDecidingNavigationPolicy()) 2623 m_frame->loader().policyChecker().stopCheck(); 2621 2624 if (m_frame->loader().state() == FrameStateProvisional) 2622 2625 m_frame->loader().stopAllLoaders(); -
trunk/Source/WebCore/loader/PolicyChecker.cpp
r224758 r228922 146 146 ResourceRequest requestCopy = request; 147 147 m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, request, didReceiveRedirectResponse, formState, [this, function = WTFMove(function), request = WTFMove(requestCopy), formState = makeRefPtr(formState), suggestedFilename = WTFMove(suggestedFilename)](PolicyAction policyAction) mutable { 148 m_delegateIsDecidingNavigationPolicy = false; 149 148 150 switch (policyAction) { 149 151 case PolicyAction::Download: … … 162 164 ASSERT_NOT_REACHED(); 163 165 }); 164 m_delegateIsDecidingNavigationPolicy = false;165 166 } 166 167
Note: See TracChangeset
for help on using the changeset viewer.