Bug 24594 - PolicyDelegate NavigationAction is WebNavigationTypeOther instead of WebNavigationTypeReload
Summary: PolicyDelegate NavigationAction is WebNavigationTypeOther instead of WebNavig...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-03-13 18:28 PDT by Greg Bolsinga
Modified: 2009-03-30 17:19 PDT (History)
1 user (show)

See Also:


Attachments
patch (3.80 KB, patch)
2009-03-30 16:57 PDT, Darin Adler
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Bolsinga 2009-03-13 18:28:41 PDT
FrameLoaderClient::dispatchDecidePolicyForNavigationAction() always called w/ NavigationAction::type() == NavigationTypeOther

This causes policy delegates to not be able to determine the action type.

It appears that this comes from the code path FrameLoader::loadWithDocumentLoader(), when not scrolling to an anchor. In this code path, the DocumentLoader::triggeringAction().isEmpty is true, and this is where the 'other' comes from.

Add the following patch to the MiniBrowser project. You'll see that the WebActionNavigationTypeKey is always 5, which is WebNavigationTypeOther.

Index: MyDocument.m
===================================================================
--- MyDocument.m	(revision 20870)
+++ MyDocument.m	(working copy)
@@ -128,6 +128,7 @@
     [webView setFrameLoadDelegate:self];
     [webView setUIDelegate:self];
     [webView setResourceLoadDelegate:self];
+    [webView setPolicyDelegate:self];
 
     // Load a default URL
     NSURL *URL = URLToLoad != nil ? URLToLoad : [NSURL URLWithString:@"http://www.apple.com"];
@@ -298,7 +299,16 @@
     [self updateResourceStatus];
 }
 
+- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation
+                                                           request:(NSURLRequest *)request
+                                                             frame:(WebFrame *)frame
+                                                  decisionListener:(id<WebPolicyDecisionListener>)listener
+{
+    NSLog(@"%@", actionInformation);
+    [listener use];
+}
 
+
 // History Methods
 
 - (void)goToHistoryItem:(id)historyItem
Comment 1 Greg Bolsinga 2009-03-13 18:38:16 PDT
<rdar://problem/6682110>
Comment 2 Darin Adler 2009-03-30 16:57:31 PDT
Created attachment 29098 [details]
patch
Comment 3 Darin Adler 2009-03-30 17:19:25 PDT
Comment on attachment 29098 [details]
patch

Sam reviewed this.
Comment 4 Darin Adler 2009-03-30 17:19:45 PDT
http://trac.webkit.org/changeset/42120