Changeset 237386 in webkit
- Timestamp:
- Oct 24, 2018 9:39:19 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r237381 r237386 1 2018-10-24 Chris Dumez <cdumez@apple.com> 2 3 [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list 4 https://bugs.webkit.org/show_bug.cgi?id=190846 5 <rdar://problem/45058938> 6 7 Reviewed by Antti Koivisto. 8 9 When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation 10 policy handler, by overriding the request URL. This normally works fine because we usually process-swap 11 on standard navigation. However, when we would process-swap on a back/forward navigation, we would end 12 up using the back/forward navigation load type to do the about:blank load. This would have repercussions 13 because history navigations update the current history item with the new URL (in this case 'about:blank'). 14 To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load 15 'about:blank' as a result. 16 17 * loader/FrameLoader.cpp: 18 (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): 19 1 20 2018-10-24 Andy Estes <aestes@apple.com> 2 21 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r237355 r237386 3364 3364 3365 3365 // We handle suspension by navigating forward to about:blank, which leaves us setup to navigate back to resume. 3366 if (shouldContinue == ShouldContinue::ForSuspension) 3366 if (shouldContinue == ShouldContinue::ForSuspension) { 3367 // Make sure we do a standard load to about:blank instead of reusing whatever the load type was on process swap. 3368 // For example, using a Back/Forward load to load about blank would cause the current HistoryItem's url to be 3369 // overwritten with 'about:blank', which we do not want. 3370 m_loadType = FrameLoadType::Standard; 3367 3371 m_provisionalDocumentLoader->willContinueMainResourceLoadAfterRedirect({ blankURL() }); 3372 } 3368 3373 3369 3374 m_provisionalDocumentLoader->startLoadingMainResource(shouldContinue); -
trunk/Tools/ChangeLog
r237383 r237386 1 2018-10-24 Chris Dumez <cdumez@apple.com> 2 3 [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list 4 https://bugs.webkit.org/show_bug.cgi?id=190846 5 <rdar://problem/45058938> 6 7 Reviewed by Antti Koivisto. 8 9 Add API test coverage. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: 12 1 13 2018-10-24 Claudio Saavedra <csaavedra@igalia.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm
r237355 r237386 1253 1253 EXPECT_EQ(1U, backForwardList.backList.count); 1254 1254 1255 // FIXME: uncomment the following once <rdar://problem/45058938> has been fixed. When enabling PSON 1256 // the backItem's URL currently becomes about:blank. 1257 // backItem = backForwardList.backItem; 1258 // EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backItem.URL absoluteString]); 1259 // EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backItem.initialURL absoluteString]); 1255 backItem = backForwardList.backItem; 1256 EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backItem.URL absoluteString]); 1257 EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backItem.initialURL absoluteString]); 1260 1258 } 1261 1259 … … 2283 2281 } 2284 2282 2283 TEST(ProcessSwap, NavigateBackAndForth) 2284 { 2285 auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); 2286 processPoolConfiguration.get().processSwapsOnNavigation = YES; 2287 auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]); 2288 2289 auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); 2290 [webViewConfiguration setProcessPool:processPool.get()]; 2291 auto handler = adoptNS([[PSONScheme alloc] init]); 2292 [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"pson"]; 2293 2294 auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]); 2295 auto delegate = adoptNS([[PSONNavigationDelegate alloc] init]); 2296 [webView setNavigationDelegate:delegate.get()]; 2297 2298 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]; 2299 [webView loadRequest:request]; 2300 2301 TestWebKitAPI::Util::run(&done); 2302 done = false; 2303 2304 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.apple.com/main.html"]]; 2305 [webView loadRequest:request]; 2306 2307 TestWebKitAPI::Util::run(&done); 2308 done = false; 2309 2310 auto* backForwardList = [webView backForwardList]; 2311 EXPECT_WK_STREQ(@"pson://www.apple.com/main.html", [backForwardList.currentItem.URL absoluteString]); 2312 EXPECT_TRUE(!backForwardList.forwardItem); 2313 EXPECT_EQ(1U, backForwardList.backList.count); 2314 EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backForwardList.backItem.URL absoluteString]); 2315 2316 [webView goBack]; 2317 TestWebKitAPI::Util::run(&done); 2318 done = false; 2319 2320 EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backForwardList.currentItem.URL absoluteString]); 2321 EXPECT_TRUE(!backForwardList.backItem); 2322 EXPECT_EQ(1U, backForwardList.forwardList.count); 2323 EXPECT_WK_STREQ(@"pson://www.apple.com/main.html", [backForwardList.forwardItem.URL absoluteString]); 2324 2325 [webView goForward]; 2326 TestWebKitAPI::Util::run(&done); 2327 done = false; 2328 2329 EXPECT_WK_STREQ(@"pson://www.apple.com/main.html", [backForwardList.currentItem.URL absoluteString]); 2330 EXPECT_TRUE(!backForwardList.forwardItem); 2331 EXPECT_EQ(1U, backForwardList.backList.count); 2332 EXPECT_WK_STREQ(@"pson://www.webkit.org/main.html", [backForwardList.backItem.URL absoluteString]); 2333 } 2334 2285 2335 #if PLATFORM(MAC) 2286 2336
Note: See TracChangeset
for help on using the changeset viewer.