[webkit-changes] cvs commit: WebKit/WebView.subproj WebFrame.m WebFrameInternal.h WebPDFView.m WebTextView.m

Kevin kdecker at opensource.apple.com
Thu Jul 14 16:40:52 PDT 2005


kdecker     05/07/14 16:40:51

  Modified:    .        Tag: Ti-2005-007-branch ChangeLog
               WebView.subproj Tag: Ti-2005-007-branch WebFrame.m
                        WebFrameInternal.h WebPDFView.m WebTextView.m
  Log:
  	Merged fix for <rdar://problem/4122282> clicking a link in an PDF file opens the link with NSWorkspace without the usual security checks or WebView delegate control
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3118.4.14.2.1 +4 -0      WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3118.4.14
  retrieving revision 1.3118.4.14.2.1
  diff -u -r1.3118.4.14 -r1.3118.4.14.2.1
  --- ChangeLog	28 Jun 2005 00:24:03 -0000	1.3118.4.14
  +++ ChangeLog	14 Jul 2005 23:40:45 -0000	1.3118.4.14.2.1
  @@ -1,3 +1,7 @@
  +2005-07-14  Kevin Decker  <kdecker at apple.com>
  +
  +	Merged fix for <rdar://problem/4122282> clicking a link in an PDF file opens the link with NSWorkspace without the usual security checks or WebView delegate control
  +
   === WebKit-412.6.1 ===
   
   2005-06-27  Adele Peterson  <adele at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.223.8.2.2.1 +13 -0     WebKit/WebView.subproj/WebFrame.m
  
  Index: WebFrame.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrame.m,v
  retrieving revision 1.223.8.2
  retrieving revision 1.223.8.2.2.1
  diff -u -r1.223.8.2 -r1.223.8.2.2.1
  --- WebFrame.m	14 Jun 2005 01:27:44 -0000	1.223.8.2
  +++ WebFrame.m	14 Jul 2005 23:40:50 -0000	1.223.8.2.2.1
  @@ -2553,6 +2553,19 @@
       return _private->internalLoadDelegate;
   }
   
  +- (void)_safeLoadURL:(NSURL *)URL
  +{
  +    // Call the bridge because this is where our security checks are made.
  +    [[self _bridge] loadURL:URL 
  +                   referrer:[[[[self dataSource] request] URL] _web_originalDataAsString]
  +                     reload:NO
  +                userGesture:YES       
  +                     target:nil
  +            triggeringEvent:[NSApp currentEvent]
  +                       form:nil 
  +                 formValues:nil];
  +}
  +
   - (void)_sendResourceLoadDelegateMessagesForURL:(NSURL *)URL response:(NSURLResponse *)response length:(unsigned)length
   {
       ASSERT(response != nil);
  
  
  
  1.7.14.1  +1 -0      WebKit/WebView.subproj/WebFrameInternal.h
  
  Index: WebFrameInternal.h
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebFrameInternal.h,v
  retrieving revision 1.7
  retrieving revision 1.7.14.1
  diff -u -r1.7 -r1.7.14.1
  --- WebFrameInternal.h	15 Mar 2005 01:45:23 -0000	1.7
  +++ WebFrameInternal.h	14 Jul 2005 23:40:50 -0000	1.7.14.1
  @@ -7,6 +7,7 @@
   - (void)_updateDrawsBackground;
   - (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
   - (id)_internalLoadDelegate;
  +- (void)_safeLoadURL:(NSURL *)URL;
   - (void)_sendResourceLoadDelegateMessagesForURL:(NSURL *)URL response:(NSURLResponse *)response length:(unsigned)length;
   - (void)_unmarkAllMisspellings;
   
  
  
  
  1.10.14.1 +13 -0     WebKit/WebView.subproj/WebPDFView.m
  
  Index: WebPDFView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebPDFView.m,v
  retrieving revision 1.10
  retrieving revision 1.10.14.1
  diff -u -r1.10 -r1.10.14.1
  --- WebPDFView.m	7 Feb 2005 06:13:54 -0000	1.10
  +++ WebPDFView.m	14 Jul 2005 23:40:50 -0000	1.10.14.1
  @@ -7,10 +7,12 @@
   
   #import <Foundation/NSString_NSURLExtras.h>
   
  +#import <WebKit/WebFrameInternal.h>
   #import <WebKit/WebAssertions.h>
   #import <WebKit/WebDataSource.h>
   #import <WebKit/WebLocalizableStrings.h>
   #import <WebKit/WebNSPasteboardExtras.h>
  +#import <WebKit/WebNSViewExtras.h>
   #import <WebKit/WebPDFView.h>
   
   #import <Quartz/Quartz.h>
  @@ -63,6 +65,7 @@
           PDFSubview = [[[[self class] PDFViewClass] alloc] initWithFrame:frame];
           [PDFSubview setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
           [self addSubview:PDFSubview];
  +        [PDFSubview setDelegate:self];
           written = NO;
       }
       return self;
  @@ -261,6 +264,16 @@
       return [[PDFSubview document] getPrintOperationForPrintInfo:printInfo autoRotate:YES];
   }
   
  +// Delegates implementing the following method will be called to handle clicks on URL
  +// links within the PDFView.  
  +- (void)PDFViewWillClickOnLink:(PDFView *)sender withURL:(NSURL *)URL
  +{
  +    if (URL != nil) {    
  +        WebFrame *frame = [[self _web_parentWebFrameView] webFrame];
  +        [frame _safeLoadURL:URL];
  +    }
  +}
  +
   @end
   
   #endif // OMIT_TIGER_FEATURES
  
  
  
  1.53.8.1.2.1 +3 -9      WebKit/WebView.subproj/WebTextView.m
  
  Index: WebTextView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebTextView.m,v
  retrieving revision 1.53.8.1
  retrieving revision 1.53.8.1.2.1
  diff -u -r1.53.8.1 -r1.53.8.1.2.1
  --- WebTextView.m	27 Jun 2005 23:54:13 -0000	1.53.8.1
  +++ WebTextView.m	14 Jul 2005 23:40:50 -0000	1.53.8.1.2.1
  @@ -16,6 +16,8 @@
   #import <WebKit/WebNSViewExtras.h>
   #import <WebKit/WebPreferences.h>
   #import <WebKit/WebTextRendererFactory.h>
  +#import <WebKit/WebFrameInternal.h>
  +
   #import <WebKit/WebViewPrivate.h>
   
   #import <Foundation/NSURLResponse.h>
  @@ -343,16 +345,8 @@
           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];
  +        [frame _saveLoadURL:URL] 
       }
   }
   
  
  
  



More information about the webkit-changes mailing list