[webkit-changes] cvs commit: WebKit/WebView.subproj WebTextView.m

Adele adele at opensource.apple.com
Mon Jun 27 16:40:12 PDT 2005


adele       05/06/27 16:40:12

  Modified:    .        Tag: Safari-1-3-branch ChangeLog
               WebView.subproj Tag: Safari-1-3-branch WebTextView.m
  Log:
  2005-06-27  Adele Peterson  <adele at apple.com>
  
          Merged fix for 4119282 from TOT to Safari-1-3-branch
  
      2005-05-17  Chris Blumenberg  <cblu at apple.com>
  
  	Fixed: <rdar://problem/4119282> clicking a link in an RTF file opens the link with NSWorkspace without the usual security checks or WebView delegate control
  
          Reviewed by mjs.
  
          * WebView.subproj/WebTextView.m:
          (-[WebTextView clickedOnLink:atIndex:]): call the loadURL bridge method so that security checks are made, command/option clicks work, policy delegate is consulted etc.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3120.2.4 +13 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3120.2.3
  retrieving revision 1.3120.2.4
  diff -u -r1.3120.2.3 -r1.3120.2.4
  --- ChangeLog	2 Jun 2005 19:26:38 -0000	1.3120.2.3
  +++ ChangeLog	27 Jun 2005 23:40:08 -0000	1.3120.2.4
  @@ -1,3 +1,16 @@
  +2005-06-27  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix for 4119282 from TOT to Safari-1-3-branch
  +
  +    2005-05-17  Chris Blumenberg  <cblu at apple.com>
  +	
  +	Fixed: <rdar://problem/4119282> clicking a link in an RTF file opens the link with NSWorkspace without the usual security checks or WebView delegate control
  +
  +        Reviewed by mjs.
  +
  +        * WebView.subproj/WebTextView.m:
  +        (-[WebTextView clickedOnLink:atIndex:]): call the loadURL bridge method so that security checks are made, command/option clicks work, policy delegate is consulted etc.
  +
   === WebKit-312.2 ===
   
   2005-06-02  Adele Peterson  <adele at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.53.6.1  +31 -2     WebKit/WebView.subproj/WebTextView.m
  
  Index: WebTextView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebTextView.m,v
  retrieving revision 1.53
  retrieving revision 1.53.6.1
  diff -u -r1.53 -r1.53.6.1
  --- WebTextView.m	5 Mar 2005 00:02:53 -0000	1.53
  +++ WebTextView.m	27 Jun 2005 23:40:12 -0000	1.53.6.1
  @@ -6,17 +6,24 @@
   #import <WebKit/WebTextView.h>
   
   #import <WebKit/WebAssertions.h>
  -#import <Foundation/NSURLResponse.h>
  -
  +#import <WebKit/WebBridge.h>
   #import <WebKit/WebDataSourcePrivate.h>
   #import <WebKit/WebDocumentInternal.h>
  +#import <WebKit/WebFramePrivate.h>
   #import <WebKit/WebFrameView.h>
   #import <WebKit/WebNSObjectExtras.h>
  +#import <WebKit/WebNSURLExtras.h>
   #import <WebKit/WebNSViewExtras.h>
   #import <WebKit/WebPreferences.h>
   #import <WebKit/WebTextRendererFactory.h>
   #import <WebKit/WebViewPrivate.h>
   
  +#import <Foundation/NSURLResponse.h>
  +
  + at interface NSTextView (AppKitSecret)
  ++ (NSURL *)_URLForString:(NSString *)string;
  + at end
  +
   @interface WebTextView (ForwardDeclarations)
   - (void)_updateTextSizeMultiplier;
   @end
  @@ -327,6 +334,28 @@
       return resign;
   }
   
  +- (void)clickedOnLink:(id)link atIndex:(unsigned)charIndex
  +{
  +    NSURL *URL = nil;
  +    if ([link isKindOfClass:[NSURL class]]) {
  +        URL = (NSURL *)link;
  +    } else if ([link isKindOfClass:[NSString class]]) {
  +        URL = [[self class] _URLForString:(NSString *)link];
  +    }
  +    if (URL != nil) {    
  +        // Call the bridge because this is where our security checks are made.
  +        WebFrame *frame = [[self _web_parentWebFrameView] webFrame];
  +        [[frame _bridge] loadURL:URL 
  +                        referrer:[[[[frame dataSource] request] URL] _web_originalDataAsString]
  +                          reload:NO
  +                     userGesture:YES       
  +                          target:nil
  +                 triggeringEvent:[[self window] currentEvent]
  +                            form:nil 
  +                      formValues:nil];
  +    }
  +}
  +
   #pragma mark PRINTING
   
   - (void)drawPageBorderWithSize:(NSSize)borderSize
  
  
  



More information about the webkit-changes mailing list