[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:57:28 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c81c20ca709c871066351e3e3dcb0d0cb086eeb9
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 6 04:00:05 2002 +0000

    WebKit:
    
    	Reworked clickPolicy arguments to be closer to proposed version.
    
            * WebKit.exp:
            * WebView.subproj/WebControllerPolicyDelegate.h:
            * WebView.subproj/WebControllerPolicyDelegate.m:
            * WebView.subproj/WebDefaultPolicyDelegate.m:
            (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]):
            * WebView.subproj/WebFramePrivate.h:
            * WebView.subproj/WebFramePrivate.m:
            (-[WebFrame _actionInformationForNavigationType:event:]):
            (-[WebFrame _continueAfterClickPolicyForEvent:request:]):
    
    WebBrowser:
    
    	Adjusted for WebKit API changes.
    
            * BrowserWebController.m:
            (-[BrowserWebController clickPolicyForAction:andRequest:inFrame:]):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2573 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 98502b8..12433aa 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2002-11-05  Maciej Stachowiak  <mjs at apple.com>
+
+	Reworked clickPolicy arguments to be closer to proposed version.
+	
+        * WebKit.exp:
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebControllerPolicyDelegate.m:
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _actionInformationForNavigationType:event:]):
+        (-[WebFrame _continueAfterClickPolicyForEvent:request:]):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
         * WebCoreSupport.subproj/WebTextRenderer.m: Made a slightly simpler and faster
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 98502b8..12433aa 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-11-05  Maciej Stachowiak  <mjs at apple.com>
+
+	Reworked clickPolicy arguments to be closer to proposed version.
+	
+        * WebKit.exp:
+        * WebView.subproj/WebControllerPolicyDelegate.h:
+        * WebView.subproj/WebControllerPolicyDelegate.m:
+        * WebView.subproj/WebDefaultPolicyDelegate.m:
+        (-[WebDefaultPolicyDelegate clickPolicyForAction:andRequest:inFrame:]):
+        * WebView.subproj/WebFramePrivate.h:
+        * WebView.subproj/WebFramePrivate.m:
+        (-[WebFrame _actionInformationForNavigationType:event:]):
+        (-[WebFrame _continueAfterClickPolicyForEvent:request:]):
+
 2002-11-05  Darin Adler  <darin at apple.com>
 
         * WebCoreSupport.subproj/WebTextRenderer.m: Made a slightly simpler and faster
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 8fe9c18..812798d 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -43,3 +43,7 @@ _WebIconNotificationUserInfoSiteURLKey
 _WebIconSmallSize
 _WebURLNamePboardType
 _WebURLPboardType
+_WebActionNavigationTypeKey
+_WebActionElementKey
+_WebActionButtonKey
+_WebActionModifierFlagsKey
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
index f05e0f9..4e01b6c 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.h
@@ -13,6 +13,28 @@
 @class WebResourceResponse;
 @class WebResourceRequest;
 
+
+/*!
+  @enum WebNavigationType
+  @abstract The type of action that triggered a possible navigation.
+  @constant WebActionTypeLinkClicked A link with an href was clicked.
+  @constant WebActionTypeFormSubmitted A form was submitted.
+  @constant WebNavigationTypeOther Navigation is taking place for some other reason.
+*/
+
+typedef enum {
+    WebNavigationTypeLinkClicked,
+    WebNavigationTypeFormSubmitted,
+    WebNavigationTypeOther
+} WebNavigationType;
+
+
+extern NSString *WebActionNavigationTypeKey; // NSNumber (WebActionType)
+extern NSString *WebActionElementKey; // NSDictionary of element info
+extern NSString *WebActionButtonKey;  // NSEventType
+extern NSString *WebActionModifierFlagsKey; // NSNumber (unsigned)
+
+
 /*!
     @enum WebPolicyAction
     @constant WebPolicyNone Unitialized state.
@@ -48,6 +70,7 @@ typedef enum {
  */
 typedef enum {
     WebClickPolicyShow = WebPolicyUse,
+    WebClickPolicyOpenExternally = WebPolicyOpenURL,
     WebClickPolicyOpenNewWindow = WebPolicyOpenNewWindow,
     WebClickPolicyOpenNewWindowBehind = WebPolicyOpenNewWindowBehind,
     WebClickPolicySave = WebPolicySave,
@@ -211,7 +234,9 @@ typedef enum {
      @param modifierFlags The modifier flags as described in NSEvent.h.
      @result The WebClickPolicy for WebKit to implement
 */
-- (WebClickPolicy *)clickPolicyForElement: (NSDictionary *)elementInformation button: (NSEventType)eventType modifierFlags: (unsigned int)modifierFlags request:(WebResourceRequest *)request inFrame:(WebFrame *)frame;
+- (WebClickPolicy *)clickPolicyForAction:(NSDictionary *)actionInformation
+                              andRequest:(WebResourceRequest *)request
+                                 inFrame:(WebFrame *)frame;
 
 /*!
     @method URLPolicyForURL:inFrame:
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
index 16175e3..26dd83f 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegate.m
@@ -5,6 +5,12 @@
 
 #import <WebKit/WebControllerPolicyDelegate.h>
 
+NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
+NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
+NSString *WebActionButtonKey = @"WebActionButtonKey"; 
+NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
+
+
 @interface WebPolicyPrivate : NSObject
 {
 @public
diff --git a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
index 982c96a..a4b5bb8 100644
--- a/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultPolicyDelegate.m
@@ -72,7 +72,9 @@
     NSLog (@"pluginNotFoundForMIMEType:pluginPageURL: - MIME %@, URL ", mime, URL);
 }
 
-- (WebClickPolicy *)clickPolicyForElement: (NSDictionary *)elementInformation button: (NSEventType)eventType modifierFlags: (unsigned int)modifierFlags request:(WebResourceRequest *)request inFrame:(WebFrame *)frame
+- (WebClickPolicy *)clickPolicyForAction:(NSDictionary *)actionInformation 
+			      andRequest:(WebResourceRequest *)request
+				 inFrame:(WebFrame *)frame
 {
     return [WebClickPolicy webPolicyWithClickAction:WebClickPolicyShow URL:nil andPath:nil];
 }
diff --git a/WebKit/WebView.subproj/WebFramePrivate.h b/WebKit/WebView.subproj/WebFramePrivate.h
index 67fbff5..d010a20 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.h
+++ b/WebKit/WebView.subproj/WebFramePrivate.h
@@ -7,6 +7,7 @@
 */
 
 #import <WebKit/WebFrame.h>
+#import <WebKit/WebControllerPolicyDelegate.h>
 
 @class WebBridge;
 @class WebFrameBridge;
@@ -96,6 +97,7 @@ typedef enum {
 - (WebFrameLoadType)_loadType;
 - (void)_goToItem: (WebHistoryItem *)item withFrameLoadType: (WebFrameLoadType)type;
 
+-(NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event;
 -(BOOL)_continueAfterClickPolicyForEvent:(NSEvent *)event request:(WebResourceRequest *)request;
 -(void)_loadURL:(NSURL *)URL loadType:(WebFrameLoadType)loadType clientRedirect:(BOOL)clientRedirect triggeringEvent:(NSEvent *)event;
 - (void)_postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 8dc713c..a2c0ce0 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -781,40 +781,72 @@ static const char * const stateNames[] = {
     [newDataSource release];
 }
 
+-(NSDictionary *)_actionInformationForNavigationType:(WebNavigationType)navigationType event:(NSEvent *)event
+{
+
+    switch (navigationType) {
+    case WebNavigationTypeLinkClicked:
+    case WebNavigationTypeFormSubmitted:
+	;
+	NSPoint point = [[[self webView] documentView] convertPoint:[event locationInWindow] fromView:nil];
+	NSDictionary *elementInfo = [(WebHTMLView *)[[self webView] documentView] _elementAtPoint:point];
+	
+	return [NSDictionary dictionaryWithObjectsAndKeys:
+			     [NSNumber numberWithInt:navigationType], WebActionNavigationTypeKey,
+			     elementInfo, WebActionElementKey,
+			     [NSNumber numberWithInt:[event type]], WebActionButtonKey,
+			     [NSNumber numberWithInt:[event modifierFlags]], WebActionModifierFlagsKey,
+			     nil];
+
+
+	break;
+    case WebNavigationTypeOther:
+	return [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:navigationType]
+			     forKey:WebActionNavigationTypeKey];
+
+	break;
+    default:
+	ASSERT_NOT_REACHED();
+	return nil;
+    }
+}
+
 -(BOOL)_continueAfterClickPolicyForEvent:(NSEvent *)event request:(WebResourceRequest *)request
 {
-    NSPoint point = [[[self webView] documentView] convertPoint:[event locationInWindow] fromView:nil];
     WebController *controller = [self controller];
     WebClickPolicy *clickPolicy;
 
-    clickPolicy = [[controller policyDelegate] clickPolicyForElement:[(WebHTMLView *)[[self webView] documentView] _elementAtPoint:point]
-                                                              button:[event type]
-                                                       modifierFlags:[event modifierFlags]
- 					                     request:request
-						             inFrame:self];
+    clickPolicy = [[controller policyDelegate] clickPolicyForAction:[self _actionInformationForNavigationType:WebNavigationTypeLinkClicked event:event]
+					       andRequest:request
+					       inFrame:self];
 
     WebPolicyAction clickAction = [clickPolicy policyAction];
     NSURL *URL = [clickPolicy URL];
 
     switch (clickAction) {
-        case WebClickPolicyShow:
-            return YES;
-        case WebClickPolicyOpenNewWindow:
-            [controller _openNewWindowWithURL:URL referrer:[[self _bridge] referrer] behind:NO];
-            break;
-        case WebClickPolicyOpenNewWindowBehind:
-            [controller _openNewWindowWithURL:URL referrer:[[self _bridge] referrer] behind:YES];
-            break;
-        case WebClickPolicySave:
-        case WebClickPolicySaveAndOpenExternally:
-            [controller _downloadURL:URL
-                   withContentPolicy:[WebContentPolicy webPolicyWithContentAction:clickAction andPath:nil]];
-            break;
-        case WebClickPolicyIgnore:
-            break;
-        default:
-            [NSException raise:NSInvalidArgumentException
-                        format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
+    case WebClickPolicyShow:
+	return YES;
+    case WebClickPolicyOpenExternally:
+	if(![[NSWorkspace sharedWorkspace] openURL:[request URL]]){
+	    [self handleUnimplementablePolicy:clickPolicy errorCode:WebErrorCannotNotFindApplicationForURL forURL:[request URL]];
+	}
+	break;
+    case WebClickPolicyOpenNewWindow:
+	[controller _openNewWindowWithURL:URL referrer:[[self _bridge] referrer] behind:NO];
+	break;
+    case WebClickPolicyOpenNewWindowBehind:
+	[controller _openNewWindowWithURL:URL referrer:[[self _bridge] referrer] behind:YES];
+	break;
+    case WebClickPolicySave:
+    case WebClickPolicySaveAndOpenExternally:
+	[controller _downloadURL:URL
+		    withContentPolicy:[WebContentPolicy webPolicyWithContentAction:clickAction andPath:nil]];
+	break;
+    case WebClickPolicyIgnore:
+	break;
+    default:
+	[NSException raise:NSInvalidArgumentException
+		     format:@"clickPolicyForElement:button:modifierFlags: returned an invalid WebClickPolicy"];
     }
     return NO;
 }
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.h b/WebKit/WebView.subproj/WebPolicyDelegate.h
index f05e0f9..4e01b6c 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.h
@@ -13,6 +13,28 @@
 @class WebResourceResponse;
 @class WebResourceRequest;
 
+
+/*!
+  @enum WebNavigationType
+  @abstract The type of action that triggered a possible navigation.
+  @constant WebActionTypeLinkClicked A link with an href was clicked.
+  @constant WebActionTypeFormSubmitted A form was submitted.
+  @constant WebNavigationTypeOther Navigation is taking place for some other reason.
+*/
+
+typedef enum {
+    WebNavigationTypeLinkClicked,
+    WebNavigationTypeFormSubmitted,
+    WebNavigationTypeOther
+} WebNavigationType;
+
+
+extern NSString *WebActionNavigationTypeKey; // NSNumber (WebActionType)
+extern NSString *WebActionElementKey; // NSDictionary of element info
+extern NSString *WebActionButtonKey;  // NSEventType
+extern NSString *WebActionModifierFlagsKey; // NSNumber (unsigned)
+
+
 /*!
     @enum WebPolicyAction
     @constant WebPolicyNone Unitialized state.
@@ -48,6 +70,7 @@ typedef enum {
  */
 typedef enum {
     WebClickPolicyShow = WebPolicyUse,
+    WebClickPolicyOpenExternally = WebPolicyOpenURL,
     WebClickPolicyOpenNewWindow = WebPolicyOpenNewWindow,
     WebClickPolicyOpenNewWindowBehind = WebPolicyOpenNewWindowBehind,
     WebClickPolicySave = WebPolicySave,
@@ -211,7 +234,9 @@ typedef enum {
      @param modifierFlags The modifier flags as described in NSEvent.h.
      @result The WebClickPolicy for WebKit to implement
 */
-- (WebClickPolicy *)clickPolicyForElement: (NSDictionary *)elementInformation button: (NSEventType)eventType modifierFlags: (unsigned int)modifierFlags request:(WebResourceRequest *)request inFrame:(WebFrame *)frame;
+- (WebClickPolicy *)clickPolicyForAction:(NSDictionary *)actionInformation
+                              andRequest:(WebResourceRequest *)request
+                                 inFrame:(WebFrame *)frame;
 
 /*!
     @method URLPolicyForURL:inFrame:
diff --git a/WebKit/WebView.subproj/WebPolicyDelegate.m b/WebKit/WebView.subproj/WebPolicyDelegate.m
index 16175e3..26dd83f 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegate.m
+++ b/WebKit/WebView.subproj/WebPolicyDelegate.m
@@ -5,6 +5,12 @@
 
 #import <WebKit/WebControllerPolicyDelegate.h>
 
+NSString *WebActionNavigationTypeKey = @"WebActionNavigationTypeKey";
+NSString *WebActionElementKey = @"WebActionNavigationTypeKey";
+NSString *WebActionButtonKey = @"WebActionButtonKey"; 
+NSString *WebActionModifierFlagsKey = @"WebActionModifierFlagsKey";
+
+
 @interface WebPolicyPrivate : NSObject
 {
 @public

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list