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

David hyatt at opensource.apple.com
Tue Aug 9 16:53:24 PDT 2005


hyatt       05/08/09 16:53:23

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               WebCoreSupport.subproj Tag: Safari-2-0-branch WebBridge.m
               WebView.subproj Tag: Safari-2-0-branch WebDataSource.m
                        WebMainResourceClient.m
  Log:
  	Land the changes to pass Acid2.
  
          * WebCoreSupport.subproj/WebBridge.m:
          (-[WebBridge determineObjectFromMIMEType:URL:]):
          * WebView.subproj/WebDataSource.m:
          (-[WebDataSource _receivedMainResourceError:complete:]):
          * WebView.subproj/WebMainResourceClient.m:
          (-[WebMainResourceClient continueAfterContentPolicy:response:]):
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3118.4.39 +11 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3118.4.38
  retrieving revision 1.3118.4.39
  diff -u -r1.3118.4.38 -r1.3118.4.39
  --- ChangeLog	9 Aug 2005 01:44:43 -0000	1.3118.4.38
  +++ ChangeLog	9 Aug 2005 23:53:18 -0000	1.3118.4.39
  @@ -1,3 +1,14 @@
  +2005-08-09  David Hyatt  <hyatt at apple.com>
  +
  +	Land the changes to pass Acid2.
  +
  +        * WebCoreSupport.subproj/WebBridge.m:
  +        (-[WebBridge determineObjectFromMIMEType:URL:]):
  +        * WebView.subproj/WebDataSource.m:
  +        (-[WebDataSource _receivedMainResourceError:complete:]):
  +        * WebView.subproj/WebMainResourceClient.m:
  +        (-[WebMainResourceClient continueAfterContentPolicy:response:]):
  +
   2005-08-08  Adele Peterson  <adele at apple.com>
   
             Merged fix from TOT to Safari-2-0-branch
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.340.8.9 +22 -15    WebKit/WebCoreSupport.subproj/WebBridge.m
  
  Index: WebBridge.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebCoreSupport.subproj/WebBridge.m,v
  retrieving revision 1.340.8.8
  retrieving revision 1.340.8.9
  diff -u -r1.340.8.8 -r1.340.8.9
  --- WebBridge.m	9 Aug 2005 00:41:11 -0000	1.340.8.8
  +++ WebBridge.m	9 Aug 2005 23:53:22 -0000	1.340.8.9
  @@ -23,6 +23,7 @@
   #import <WebKit/WebHistoryItemPrivate.h>
   #import <WebKit/WebHTMLRepresentationPrivate.h>
   #import <WebKit/WebHTMLViewInternal.h>
  +#import <WebKit/WebImageView.h>
   #import <WebKit/WebJavaPlugIn.h>
   #import <WebKit/WebJavaScriptTextInputPanel.h>
   #import <WebKit/WebKitErrorsPrivate.h>
  @@ -1071,30 +1072,36 @@
       return cacheSize * multiplier;
   }
   
  -- (BOOL)frameRequiredForMIMEType:(NSString *)MIMEType URL:(NSURL *)URL
  +- (ObjectElementType)determineObjectFromMIMEType:(NSString*)MIMEType URL:(NSURL*)URL
   {
       if ([MIMEType length] == 0) {
  +        // Try to guess the MIME type based off the extension.
           NSString *extension = [[URL path] pathExtension];
  -        if ([extension length] > 0 && [[WebPluginDatabase installedPlugins] pluginForExtension:extension] != nil) {
  -            // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
  -            return NO;
  -        } else {
  -            // Else, create a frame and attempt to load the URL in there.
  -            return YES;
  +        if ([extension length] > 0) {
  +            MIMEType = [[NSURLFileTypeMappings sharedMappings] MIMETypeForExtension:extension];
  +            if ([MIMEType length] == 0 && [[WebPluginDatabase installedPlugins] pluginForExtension:extension])
  +                // If no MIME type is specified, use a plug-in if we have one that can handle the extension.
  +                return ObjectElementPlugin;
           }
       }
  -    
  +
  +    if ([MIMEType length] == 0)
  +        return ObjectElementFrame; // Go ahead and hope that we can display the content.
  +                
       Class viewClass = [WebFrameView _viewClassForMIMEType:MIMEType];
  -    if (!viewClass) {
  -        // Want to display a "plugin not found" dialog/image, so let a plugin get made.
  -        return NO;
  -    }
  -        
  +    if (!viewClass)
  +        // Nothing is registered at all.
  +        return ObjectElementNone;
  +    
  +    if ([viewClass isSubclassOfClass:[WebImageView class]])
  +        return ObjectElementImage;
  +    
       // If we're a supported type other than a plugin, we want to make a frame.
       // Ultimately we should just use frames for all mime types (plugins and HTML/XML/text documents),
       // but for now we're burdened with making a distinction between the two.
  -    return !([viewClass isSubclassOfClass:[WebNetscapePluginDocumentView class]] || 
  -             [viewClass isSubclassOfClass:[WebPluginDocumentView class]]);
  +    if ([viewClass isSubclassOfClass:[WebNetscapePluginDocumentView class]] || [viewClass isSubclassOfClass:[WebPluginDocumentView class]])
  +        return ObjectElementPlugin;
  +    return ObjectElementFrame;
   }
   
   - (void)loadEmptyDocumentSynchronously
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.198.8.2 +3 -1      WebKit/WebView.subproj/WebDataSource.m
  
  Index: WebDataSource.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/WebDataSource.m,v
  retrieving revision 1.198.8.1
  retrieving revision 1.198.8.2
  diff -u -r1.198.8.1 -r1.198.8.2
  --- WebDataSource.m	14 Jun 2005 01:27:44 -0000	1.198.8.1
  +++ WebDataSource.m	9 Aug 2005 23:53:22 -0000	1.198.8.2
  @@ -815,7 +815,9 @@
       if (isComplete) {
           // Can't call [self _bridge] because we might not have commited yet
           [[[self webFrame] _bridge] stop];
  -    }        
  +        [[[self webFrame] _bridge] mainResourceError];
  +    }
  +
       [[self webFrame] _receivedMainResourceError:error];
       [[self _webView] _mainReceivedError:error
                              fromDataSource:self
  
  
  
  1.260.8.3 +9 -0      WebKit/WebView.subproj/Attic/WebMainResourceClient.m
  
  Index: WebMainResourceClient.m
  ===================================================================
  RCS file: /cvs/root/WebKit/WebView.subproj/Attic/WebMainResourceClient.m,v
  retrieving revision 1.260.8.2
  retrieving revision 1.260.8.3
  diff -u -r1.260.8.2 -r1.260.8.3
  --- WebMainResourceClient.m	2 Jul 2005 01:32:45 -0000	1.260.8.2
  +++ WebMainResourceClient.m	9 Aug 2005 23:53:23 -0000	1.260.8.3
  @@ -31,6 +31,7 @@
   #import <WebKit/WebNSURLExtras.h>
   #import <WebKit/WebPolicyDelegatePrivate.h>
   #import <WebKit/WebViewPrivate.h>
  +#import <WebKit/WebBridge.h>
   
   // FIXME: More that is in common with WebSubresourceClient should move up into WebBaseResourceHandleDelegate.
   
  @@ -242,6 +243,14 @@
   
       [self retain];
   
  +    if ([r isKindOfClass:[NSHTTPURLResponse class]]) {
  +        int status = [(NSHTTPURLResponse *)r statusCode];
  +        if (status < 200 || status >= 300) {
  +	    // Handle <object> fallback for error cases.
  +	    [[[dataSource webFrame] _bridge] mainResourceError];
  +        }
  +    }
  +
       [super didReceiveResponse:r];
     
       if (![dataSource _isStopping] && ([URL _webkit_shouldLoadAsEmptyDocument] || [WebView _representationExistsForURLScheme:[URL scheme]])) {
  
  
  



More information about the webkit-changes mailing list