Changeset 261761 in webkit
- Timestamp:
- May 15, 2020 2:31:22 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261735 r261761 1 2020-05-15 Alex Christensen <achristensen@webkit.org> 2 3 Regression (iOS 13.4, r249142): WKWebView.loading is never reset after a Back navigation in an iframe 4 https://bugs.webkit.org/show_bug.cgi?id=211449 5 6 Reviewed by Geoffrey Garen. 7 8 Always call clearPendingAPIRequest in WebPageProxy::didStartProvisionalLoadForFrameShared. 9 r249142 regressed this and caused more "loading appears to continue forever" bugs fixed in r249890. 10 This should fix both, by removing the problematic half of r249142. 11 12 Covered by an API test. 13 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): 16 1 17 2020-05-15 Adrian Perez de Castro <aperez@igalia.com> 2 18 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r261727 r261761 4445 4445 4446 4446 auto transaction = m_pageLoadState.transaction(); 4447 bool fromAlternateHTMLAPI = !unreachableURL.isEmpty() && unreachableURL == m_pageLoadState.pendingAPIRequestURL(); 4448 if (navigation || fromAlternateHTMLAPI) 4449 m_pageLoadState.clearPendingAPIRequest(transaction); 4447 m_pageLoadState.clearPendingAPIRequest(transaction); 4450 4448 4451 4449 if (frame->isMainFrame()) { -
trunk/Tools/ChangeLog
r261758 r261761 1 2020-05-15 Alex Christensen <achristensen@webkit.org> 2 3 Regression (iOS 13.4, r249142): WKWebView.loading is never reset after a Back navigation in an iframe 4 https://bugs.webkit.org/show_bug.cgi?id=211449 5 6 Reviewed by Geoffrey Garen. 7 8 * TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm: 9 (-[LoadingObserver changesObserved]): 10 (-[LoadingObserver observeValueForKeyPath:ofObject:change:context:]): 11 (TEST): 12 1 13 2020-05-15 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm
r260546 r261761 26 26 #import "config.h" 27 27 28 #import "HTTPServer.h" 29 #import "PlatformUtilities.h" 30 #import "Test.h" 31 #import "TestUIDelegate.h" 32 #import "TestURLSchemeHandler.h" 28 33 #import <WebKit/WKBackForwardListPrivate.h> 29 34 #import <WebKit/WKNavigationActionPrivate.h> … … 34 39 #import <wtf/RetainPtr.h> 35 40 #import <wtf/Vector.h> 36 #import "PlatformUtilities.h"37 #import "Test.h"38 #import "TestURLSchemeHandler.h"39 41 40 42 static bool isDone; … … 672 674 TestWebKitAPI::Util::run(&isDone); 673 675 } 676 674 677 #endif // PLATFORM(MAC) 678 679 #if HAVE(NETWORK_FRAMEWORK) 680 681 @interface LoadingObserver : NSObject 682 @property (nonatomic, readonly) size_t changesObserved; 683 @end 684 685 @implementation LoadingObserver { 686 size_t _changesObserved; 687 } 688 689 - (size_t)changesObserved 690 { 691 return _changesObserved; 692 } 693 694 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context 695 { 696 EXPECT_WK_STREQ(keyPath, "loading"); 697 _changesObserved++; 698 } 699 700 @end 701 702 TEST(WKNavigation, FrameBackLoading) 703 { 704 using namespace TestWebKitAPI; 705 HTTPServer server({ 706 { "/", { "<iframe src='frame1.html'></iframe>" } }, 707 { "/frame1.html", { "<a href='frame2.html'>link</a>" } }, 708 { "/frame2.html", { "<script>alert('frame2 loaded')</script>" } }, 709 }); 710 auto webView = [[WKWebView new] autorelease]; 711 auto delegate = [[TestUIDelegate new] autorelease]; 712 auto observer = [[LoadingObserver new] autorelease]; 713 webView.UIDelegate = delegate; 714 [webView addObserver:observer forKeyPath:@"loading" options:NSKeyValueObservingOptionNew context:nil]; 715 EXPECT_FALSE(webView.loading); 716 EXPECT_EQ(observer.changesObserved, 0u); 717 [webView loadRequest:server.request()]; 718 EXPECT_TRUE(webView.loading); 719 EXPECT_EQ(observer.changesObserved, 1u); 720 while (observer.changesObserved < 2u) 721 Util::spinRunLoop(); 722 EXPECT_FALSE(webView.loading); 723 EXPECT_EQ(observer.changesObserved, 2u); 724 EXPECT_FALSE(webView.canGoBack); 725 [webView evaluateJavaScript:@"document.querySelector('iframe').contentWindow.document.querySelector('a').click()" completionHandler:nil]; 726 EXPECT_WK_STREQ([delegate waitForAlert], "frame2 loaded"); 727 EXPECT_EQ(observer.changesObserved, 2u); 728 EXPECT_TRUE(webView.canGoBack); 729 [webView goBack]; 730 while (observer.changesObserved < 3) 731 Util::spinRunLoop(); 732 EXPECT_TRUE(webView.loading); 733 while (observer.changesObserved < 4) 734 Util::spinRunLoop(); 735 EXPECT_FALSE(webView.loading); 736 [webView removeObserver:observer forKeyPath:@"loading"]; 737 738 } 739 740 #endif // HAVE(NETWORK_FRAMEWORK)
Note: See TracChangeset
for help on using the changeset viewer.