Changeset 176096 in webkit
- Timestamp:
- Nov 13, 2014 3:22:50 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176091 r176096 1 2014-11-13 Dan Bernstein <mitz@apple.com> 2 3 Policy client not called for navigations through the page cache 4 https://bugs.webkit.org/show_bug.cgi?id=138703 5 6 Reviewed by Alexey Proskuryakov. 7 8 Test added to TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm. 9 10 * loader/FrameLoader.cpp: 11 (WebCore::FrameLoader::loadDifferentDocumentItem): When using a cached page, which already 12 has a document loader, set the document loader’s triggering action (so that the policy 13 client sees that this is a back/forward navigation) and clear its last checked request (so 14 that the policy client gets called). 15 1 16 2014-11-13 Joanmarie Diggs <jdiggs@igalia.com> 2 17 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r175719 r176096 3154 3154 3155 3155 if (CachedPage* cachedPage = pageCache()->get(item)) { 3156 loadWithDocumentLoader(cachedPage->documentLoader(), loadType, 0, AllowNavigationToInvalidURL::Yes); 3156 auto documentLoader = cachedPage->documentLoader(); 3157 documentLoader->setTriggeringAction(NavigationAction(documentLoader->request(), loadType, false)); 3158 documentLoader->setLastCheckedRequest(ResourceRequest()); 3159 loadWithDocumentLoader(documentLoader, loadType, 0, AllowNavigationToInvalidURL::Yes); 3157 3160 return; 3158 3161 } -
trunk/Tools/ChangeLog
r176091 r176096 1 2014-11-13 Dan Bernstein <mitz@apple.com> 2 3 Policy client not called for navigations through the page cache 4 https://bugs.webkit.org/show_bug.cgi?id=138703 5 6 Reviewed by Alexey Proskuryakov. 7 8 * TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm: 9 (-[DecidePolicyForPageCacheNavigationDelegate webView:didFinishNavigation:]): 10 (-[DecidePolicyForPageCacheNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): 11 1 12 2014-11-13 Joanmarie Diggs <jdiggs@igalia.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm
r171626 r176096 91 91 ASSERT_TRUE([[currentNavigation _request] isEqual:request]); 92 92 93 isDone = false; 93 94 TestWebKitAPI::Util::run(&isDone); 94 95 } … … 136 137 ASSERT_TRUE([[currentNavigation _request] isEqual:request]); 137 138 139 isDone = false; 138 140 TestWebKitAPI::Util::run(&isDone); 139 141 } 140 142 143 @interface DecidePolicyForPageCacheNavigationDelegate : NSObject <WKNavigationDelegate> 144 @property (nonatomic) BOOL decidedPolicyForBackForwardNavigation; 145 @end 146 147 @implementation DecidePolicyForPageCacheNavigationDelegate 148 149 - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation 150 { 151 isDone = true; 152 } 153 154 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler 155 { 156 if (navigationAction.navigationType == WKNavigationTypeBackForward) 157 _decidedPolicyForBackForwardNavigation = YES; 158 159 decisionHandler(WKNavigationActionPolicyAllow); 160 } 161 162 @end 163 164 TEST(WKNavigation, DecidePolicyForPageCacheNavigation) 165 { 166 RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); 167 168 RetainPtr<DecidePolicyForPageCacheNavigationDelegate> delegate = adoptNS([[DecidePolicyForPageCacheNavigationDelegate alloc] init]); 169 [webView setNavigationDelegate:delegate.get()]; 170 171 NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"data:text/html,1"]]; 172 173 isDone = false; 174 [webView loadRequest:request]; 175 TestWebKitAPI::Util::run(&isDone); 176 177 request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"data:text/html,2"]]; 178 179 isDone = false; 180 [webView loadRequest:request]; 181 TestWebKitAPI::Util::run(&isDone); 182 183 isDone = false; 184 [webView goBack]; 185 TestWebKitAPI::Util::run(&isDone); 186 187 ASSERT_TRUE([delegate decidedPolicyForBackForwardNavigation]); 188 } 189 141 190 #endif
Note: See TracChangeset
for help on using the changeset viewer.