Changeset 226929 in webkit
- Timestamp:
- Jan 12, 2018, 4:39:34 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r226927 r226929 1 2018-01-12 Alex Christensen <achristensen@webkit.org> 2 3 History state should be updated during client redirects with asynchronous policy decisions 4 https://bugs.webkit.org/show_bug.cgi?id=181358 5 <rdar://problem/35547689> 6 7 Reviewed by Andy Estes. 8 9 When decidePolicyForNavigationAction is responded to asynchronously during a client redirect, 10 HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because 11 the document loader has not been marked as a client redirect because the FrameLoader only looks 12 at its provisional document loader to mark it as a client redirect. When decidePolicyForNavigationAction 13 is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to 14 its policy document loader. To get both asynchronous and synchronous cases, let's just mark the document 15 loader as a client redirect whether it's the provisional or policy document loader. 16 17 Covered by a new API test. 18 19 * loader/FrameLoader.cpp: 20 (WebCore::FrameLoader::loadURL): 21 (WebCore::FrameLoader::loadPostRequest): 22 1 23 2018-01-12 Dean Jackson <dino@apple.com> 2 24 -
TabularUnified trunk/Source/WebCore/loader/FrameLoader.cpp ¶
r226745 r226929 1343 1343 if (m_provisionalDocumentLoader) 1344 1344 m_provisionalDocumentLoader->setIsClientRedirect(true); 1345 else if (m_policyDocumentLoader) 1346 m_policyDocumentLoader->setIsClientRedirect(true); 1345 1347 } else if (sameURL && !isReload(newLoadType)) { 1346 1348 // Example of this case are sites that reload the same URL with a different cookie … … 2776 2778 if (m_provisionalDocumentLoader) 2777 2779 m_provisionalDocumentLoader->setIsClientRedirect(true); 2780 else if (m_policyDocumentLoader) 2781 m_policyDocumentLoader->setIsClientRedirect(true); 2778 2782 } 2779 2783 } -
TabularUnified trunk/Tools/ChangeLog ¶
r226918 r226929 1 2018-01-12 Alex Christensen <achristensen@webkit.org> 2 3 History state should be updated during client redirects with asynchronous policy decisions 4 https://bugs.webkit.org/show_bug.cgi?id=181358 5 <rdar://problem/35547689> 6 7 Reviewed by Andy Estes. 8 9 * TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm: 10 (-[AsyncPolicyDecisionDelegate webView:didFinishNavigation:]): 11 (-[AsyncPolicyDecisionDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): 12 (TEST): 13 1 14 2018-01-12 Jonathan Bedard <jbedard@apple.com> 2 15 -
TabularUnified trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm ¶
r207445 r226929 104 104 } 105 105 106 static bool done; 107 static size_t navigations; 108 109 @interface AsyncPolicyDecisionDelegate : NSObject <WKNavigationDelegate, WKUIDelegate> 110 @end 111 112 @implementation AsyncPolicyDecisionDelegate 113 114 - (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation 115 { 116 if (navigations++) 117 done = true; 118 } 119 120 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler 121 { 122 dispatch_async(dispatch_get_main_queue(), ^{ 123 decisionHandler(WKNavigationActionPolicyAllow); 124 }); 125 } 126 127 @end 128 129 TEST(WKBackForwardList, WindowLocationAsyncPolicyDecision) 130 { 131 NSURL *simple = [[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 132 NSURL *simple2 = [[NSBundle mainBundle] URLForResource:@"simple2" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 133 auto webView = adoptNS([[WKWebView alloc] init]); 134 auto delegate = adoptNS([[AsyncPolicyDecisionDelegate alloc] init]); 135 [webView setNavigationDelegate:delegate.get()]; 136 [webView loadHTMLString:@"<script>window.location='simple.html'</script>" baseURL:simple2]; 137 TestWebKitAPI::Util::run(&done); 138 EXPECT_STREQ(webView.get().backForwardList.currentItem.URL.absoluteString.UTF8String, simple.absoluteString.UTF8String); 139 } 140 106 141 #endif
Note:
See TracChangeset
for help on using the changeset viewer.