WebKit:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2003 03:37:15 +0000 (03:37 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 26 Mar 2003 03:37:15 +0000 (03:37 +0000)
        Changed use of plugin to plugIn in our public API
        as instructed by those that must be obeyed.

        Reviewed by Trey.

        Changed userStyleSheetLocation to take/pass an NSURL.

        Reviewed by Chris

        * Plugins.subproj/WebNetscapePluginDocumentView.m:
        (-[WebNetscapePluginDocumentView setDataSource:]):
        * Plugins.subproj/WebNullPluginView.h:
        * Plugins.subproj/WebNullPluginView.m:
        (-[WebNullPluginView viewDidMoveToWindow]):
        * Plugins.subproj/WebPluginError.h:
        * Plugins.subproj/WebPluginError.m:
        (-[WebPlugInError plugInPageURL]):
        (-[WebPlugInError plugInName]):
        * Plugins.subproj/WebPluginErrorPrivate.h:
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]):
        (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]):
        * WebView.subproj/WebDefaultResourceLoadDelegate.m:
        (-[WebDefaultResourceLoadDelegate webView:plugInFailedWithError:dataSource:]):
        * WebView.subproj/WebPreferences.h:
        * WebView.subproj/WebPreferences.m:
        (-[WebPreferences userStyleSheetLocation]):
        (-[WebPreferences setUserStyleSheetLocation:]):
        * WebView.subproj/WebResourceLoadDelegate.h:
        * WebView.subproj/WebViewPrivate.m:
        (-[WebView _updateWebCoreSettingsFromPreferences:]):

        * API-Issues.rtf:  notes to self

WebBrowser:
        Changed use of plugin to plugIn in our public API
        as instructed by those that must be obeyed.

        Reviewed by Trey.

        * LoadProgressMonitor.m:
        (-[LoadProgressMonitor webView:plugInFailedWithError:dataSource:]):
        * Preferences.subproj/AdvancedPreferences.m:
        (-[AdvancedPreferences setStyleSheetPathPreference:]):
        (-[AdvancedPreferences styleSheetPathPreference]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@3921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
WebKit/API-Issues.rtf
WebKit/ChangeLog
WebKit/Plugins.subproj/WebNetscapePluginDocumentView.m
WebKit/Plugins.subproj/WebNullPluginView.h
WebKit/Plugins.subproj/WebNullPluginView.m
WebKit/Plugins.subproj/WebPlugInError.h
WebKit/Plugins.subproj/WebPlugInError.m
WebKit/Plugins.subproj/WebPluginErrorPrivate.h
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebDefaultResourceLoadDelegate.m
WebKit/WebView.subproj/WebPreferences.h
WebKit/WebView.subproj/WebPreferences.m
WebKit/WebView.subproj/WebResourceLoadDelegate.h
WebKit/WebView.subproj/WebViewPrivate.m

index 67abbd1..23710cb 100644 (file)
@@ -3,7 +3,7 @@
 }
 {\colortbl;\red255\green255\blue255;\red0\green0\blue221;\red0\green99\blue18;\red118\green15\blue80;
 \red84\green0\blue0;\red35\green110\blue37;}
-\margl1440\margr1440\vieww16540\viewh12180\viewkind0
+\margl1440\margr1440\vieww15360\viewh16060\viewkind0
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
 
 \f0\b\fs24 \cf0 API Cleanup:
 \f1\fs24 \cf0 \
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
 
-\f2\fs20 \cf0 \CocoaLigature0 + put class methods from WebContentTypes back on WebController (WebView)\
-move isDocumentHTML off WebFrameView and WebDataSource\
-\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
-
-\f1\fs24 \cf2 \CocoaLigature1 Why are these class methods? Global per-program settings seem wrong for these. They needs to be settable per-controller.\
-\
-+ (void)setUsesPageCache: (BOOL)flag;\
-+ (BOOL)usesPageCache;\
-+ (void)setPageCacheSize: (unsigned)size;\
-+ (unsigned)pageCacheSize;\
+\f2\fs20 \cf0 \CocoaLigature0 + move isDocumentHTML off WebFrameView and WebDataSource\
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\cf0 Yes, good point.\
-\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
-\cf2 Is it an entry or an item? Let's pick one of Item or Entry and stick to it, in both class names and method names.\
-\
-- (void)addEntry:(WebHistoryItem *)entry;\
-- (void)goToEntry:(WebHistoryItem *)entry;\
-- (WebHistoryItem *)currentEntry;\
-- (WebHistoryItem *)forwardEntry;\
-- (BOOL)containsEntry:(WebHistoryItem *)entry;\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\cf0 We will standardize on Item.\
-\
+
+\f1\fs24 \cf0 \CocoaLigature1 \
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
 \cf2 \
 It seems non-parallel that WebHistory has change notifications but WebBackForwardList doesn't.\
@@ -52,16 +31,6 @@ It seems non-parallel that WebHistory has change notifications but WebBackForwar
 \cf0 Yes, this is not good.  It's an artifact of implementation, not intentional design.\
 \
 \
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
-\cf2 + (WebHistory *)createSharedHistoryWithFile: (NSString*)file;\
-\
-how about this (seems closer to existing Cocoa practice):\
-\
-+(void)setSharedHistory:(WebHistory *)history\
-\
-Same issue about entry vs. item for history.\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\cf0 Good suggestion.\
 \
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
 \cf2 WebHistoryPrivate.h (not included, but I looked) includes WebHistory methods with no leading underscore. Private methods should start with an underscore.\
@@ -108,17 +77,6 @@ The direction in new APIs has been to use URL instead of file names where applic
 \
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
 \cf2 \
-Seems like a whole lot of convenience; why not just\
-\
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
-
-\f2\fs20 \cf2 - (void)addEntries:(NSArray *)newEntries;\
-- (void)removeEntries:(NSArray *)entries;
-\f1\fs24 \cf2 \
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
-\cf0 Yes, this suggestion is reasonable.  Add removeAll.\
-\
-\
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li400\ql\qnatural
 
 \f2\fs20 \cf3 - (NSArray *)orderedLastVisitedDays;\
@@ -266,4 +224,53 @@ loadsImagesAutomatically, ... ?\
 Thanks!\
 \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
 \cf2 Ali\
+\
+\
+Add loadWithData:baseURL: to WebFrame\
+\
+\
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+\cf0 Looking over the 3/19 headers you sent, I noticed that some of the WebView delegate methods don't follow the Cocoa naming conventions for delegate (and notification) methods--specifically, not all of them use the keywords "will", and "did" consistently. For example, the WebLocationChangeDelegate informal protocol has a webView:willCloseLocationForDataSource: method but all of the other method names do not conform to this style. On the other hand, most of the methods in WebResourceLoadDelegate conform to this style except one. Also, some of the names use "forDataSource", and others use "fromDataSource" (which seems confusing since the sender is now a WebView).\
+\
+Here's some suggestions for renaming the methods that don't conform to this style:\
+\
+\
+WebLocationChangeDelegate\
+\
+- webView:willChangeLocationForDataSource:\
+- webView:didRedirectServer:forDataSource:\
+- webView:didCommitLocationChangeForDataSource:\
+- webView:didReceivePageTitle:forDataSource:\
+- webView:didReceivePageIcon:forDataSource:\
+- webView:didFinishLocationChangeWithError:ForDataSource:\
+\
+Actually, perhaps -webView:didStartLocationChangeForDataSource: is more accurate. - Nancy\
+\
+\
+WebResourceLoadDelegate\
+\
+- webView:plugInDidFailWithError:forDataSource:\
+\
+** For consistency, all the "fromDataSource" text should be replaced with "forDataSource"?\
+*** Also, replace "plugin" with "plugIn".\
+\
+\
+- Nancy\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li200\ql\qnatural
+\cf2 \
+\
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+\cf0 Richard,\
+\
+Shouldn't the WebHistory -addItems: and -removeItems: methods be named:\
+\
+- addItemsFromArray:\
+- removeItemsInArray:\
+\
+See NSArray, NSMutableArray, NSBundle, and NSSet for similar method names.\
+\
+- Nancy\
+\
+P.S. The WebHistory.h file you dropped a few days ago doesn't contain the file->URL changes you mentioned. Can't write the method descriptions for this class until I get the new headers.\cf2 \
 }
\ No newline at end of file
index db2b975..73caf4e 100644 (file)
@@ -1,3 +1,39 @@
+2003-03-25  Richard Williamson   <rjw@apple.com>
+
+        Changed use of plugin to plugIn in our public API
+        as instructed by those that must be obeyed.
+        
+        Reviewed by Trey.
+
+        Changed userStyleSheetLocation to take/pass an NSURL.
+        
+        Reviewed by Chris
+        
+        * Plugins.subproj/WebNetscapePluginDocumentView.m:
+        (-[WebNetscapePluginDocumentView setDataSource:]):
+        * Plugins.subproj/WebNullPluginView.h:
+        * Plugins.subproj/WebNullPluginView.m:
+        (-[WebNullPluginView viewDidMoveToWindow]):
+        * Plugins.subproj/WebPluginError.h:
+        * Plugins.subproj/WebPluginError.m:
+        (-[WebPlugInError plugInPageURL]):
+        (-[WebPlugInError plugInName]):
+        * Plugins.subproj/WebPluginErrorPrivate.h:
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge viewForPluginWithURL:attributes:baseURL:MIMEType:]):
+        (-[WebBridge viewForJavaAppletWithFrame:attributes:baseURL:]):
+        * WebView.subproj/WebDefaultResourceLoadDelegate.m:
+        (-[WebDefaultResourceLoadDelegate webView:plugInFailedWithError:dataSource:]):
+        * WebView.subproj/WebPreferences.h:
+        * WebView.subproj/WebPreferences.m:
+        (-[WebPreferences userStyleSheetLocation]):
+        (-[WebPreferences setUserStyleSheetLocation:]):
+        * WebView.subproj/WebResourceLoadDelegate.h:
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView _updateWebCoreSettingsFromPreferences:]):
+
+        * API-Issues.rtf:  notes to self
+
 2003-03-25  Chris Blumenberg  <cblu@apple.com>
 
        Fixed: 3135385 - many file types don't work with the QuickTime plugin in Safari
index 8d7ace9..5de0b09 100644 (file)
     if (![thePlugin load]){
         // FIXME: It would be nice to stop the load here.
 
-        WebPluginError *error = [WebPluginError pluginErrorWithCode:WebKitErrorCannotLoadPlugin
+        WebPlugInError *error = [WebPlugInError pluginErrorWithCode:WebKitErrorCannotLoadPlugin
                                                          contentURL:[[[theDataSource request] URL] absoluteString]
                                                       pluginPageURL:nil
                                                          pluginName:[thePlugin name]
                                                            MIMEType:MIME];
         
         WebView *c = [[theDataSource webFrame] webView];
-        [[c _resourceLoadDelegateForwarder] webView:c pluginFailedWithError:error dataSource:theDataSource];
+        [[c _resourceLoadDelegateForwarder] webView:c plugInFailedWithError:error dataSource:theDataSource];
         
         return;
     }
index 018dac4..7a4b9e8 100644 (file)
@@ -5,14 +5,14 @@
 
 #import <AppKit/AppKit.h>
 
-@class WebPluginError;
+@class WebPlugInError;
 
 @interface WebNullPluginView : NSImageView
 {
     BOOL didSendError;
-    WebPluginError *error;
+    WebPlugInError *error;
 }
 
-- initWithFrame:(NSRect)frame error:(WebPluginError *)pluginError;
+- initWithFrame:(NSRect)frame error:(WebPlugInError *)pluginError;
 
 @end
index 2a95e3b..8a3446b 100644 (file)
@@ -18,7 +18,7 @@ static NSImage *image = nil;
 
 @implementation WebNullPluginView
 
-- initWithFrame:(NSRect)frame error:(WebPluginError *)pluginError;
+- initWithFrame:(NSRect)frame error:(WebPlugInError *)pluginError;
 {    
     self = [super initWithFrame:frame];
     if (self) {
@@ -51,7 +51,7 @@ static NSImage *image = nil;
         WebView *webView = [webFrame webView];
         WebDataSource *dataSource = [webFrame dataSource];
         
-        [[webView _resourceLoadDelegateForwarder] webView:webView pluginFailedWithError:error dataSource:dataSource];
+        [[webView _resourceLoadDelegateForwarder] webView:webView plugInFailedWithError:error dataSource:dataSource];
     }
 }
 
index 1702ef7..bbf9564 100644 (file)
 
 #import <WebFoundation/WebError.h>
 
-@class WebPluginErrorPrivate;
+@class WebPlugInErrorPrivate;
 
 /*!
-    @class WebPluginError
-    @discussion WebPluginError is a subclass of WebError that is specific to plug-in related errors.
+    @class WebPlugInError
+    @discussion WebPlugInError is a subclass of WebError that is specific to plug-in related errors.
 */
-@interface WebPluginError : WebError
+@interface WebPlugInError : WebError
 {
 @private
-    WebPluginErrorPrivate *_private;
+    WebPlugInErrorPrivate *_private;
 }
 
 /*!
     @result The URL of the data that caused the error
 */
 - (NSString *)contentURL;
+
 /*!
-    @method pluginPageURL
+    @method plugInPageURL
     @result Description forthcoming
 */
-- (NSString *)pluginPageURL;
+- (NSString *)plugInPageURL;
+
 /*!
-    @method pluginName
+    @method pluInName
     @result The name of plugin that experienced the error
 */
-- (NSString *)pluginName;
+- (NSString *)plugInName;
+
 /*!
     @method MIMEType
     @result The MIME type of the data that caused the error
index f2f5b6d..75be76c 100644 (file)
@@ -1,5 +1,5 @@
 //
-//  WebPluginError.m
+//  WebPlugInError.m
 //  WebKit
 //
 //  Created by Chris Blumenberg on Fri Nov 01 2002.
@@ -7,10 +7,10 @@
 //
 
 #import <WebKit/WebKitErrors.h>
-#import <WebKit/WebPluginErrorPrivate.h>
+#import <WebKit/WebPlugInErrorPrivate.h>
 
 
-@interface WebPluginErrorPrivate : NSObject
+@interface WebPlugInErrorPrivate : NSObject
 {
 @public
     NSString *contentURL;
@@ -21,7 +21,7 @@
 
 @end
 
-@implementation WebPluginErrorPrivate
+@implementation WebPlugInErrorPrivate
 
 - (void)dealloc
 {
@@ -34,7 +34,7 @@
 
 @end
 
-@implementation WebPluginError
+@implementation WebPlugInError
 
 - (void)dealloc
 {
     return _private->contentURL;
 }
 
-- (NSString *)pluginPageURL
+- (NSString *)plugInPageURL
 {
     return _private->pluginPageURL;
 }
 
-- (NSString *)pluginName
+- (NSString *)plugInName
 {
     return _private->pluginName;
 }
 
 @end
 
-@implementation WebPluginError (WebPrivate)
+@implementation WebPlugInError (WebPrivate)
 
-+ (WebPluginError *)pluginErrorWithCode:(int)code
++ (WebPlugInError *)pluginErrorWithCode:(int)code
                              contentURL:(NSString *)contentURL
                           pluginPageURL:(NSString *)pluginPageURL
                              pluginName:(NSString *)pluginName
                                MIMEType:(NSString *)MIMEType;
 {
-    WebPluginError *error = [[WebPluginError alloc] initWithErrorWithCode:code
+    WebPlugInError *error = [[WebPlugInError alloc] initWithErrorWithCode:code
                                                                contentURL:contentURL
                                                             pluginPageURL:pluginPageURL
                                                                pluginName:pluginName
@@ -88,7 +88,7 @@
 {
     [super initWithErrorCode:code inDomain:WebErrorDomainWebKit failingURL:contentURL];
 
-    _private = [[WebPluginErrorPrivate alloc] init];
+    _private = [[WebPlugInErrorPrivate alloc] init];
     _private->contentURL = [contentURL retain];
     _private->pluginPageURL = [pluginPageURL retain];
     _private->pluginName = [pluginName retain];
index 51c5944..32866aa 100644 (file)
@@ -9,9 +9,9 @@
 
 #import <WebKit/WebPluginError.h>
 
-@interface WebPluginError (WebPrivate)
+@interface WebPlugInError (WebPrivate)
 
-+ (WebPluginError *)pluginErrorWithCode:(int)code
++ (WebPlugInError *)pluginErrorWithCode:(int)code
                              contentURL:(NSString *)contentURL
                           pluginPageURL:(NSString *)URL
                              pluginName:(NSString *)pluginName
index 5745a08..10d502f 100644 (file)
     }
 
     if(errorCode){
-        WebPluginError *error = [WebPluginError pluginErrorWithCode:errorCode
+        WebPlugInError *error = [WebPlugInError pluginErrorWithCode:errorCode
                                                          contentURL:URL
                                                       pluginPageURL:[attributes objectForKey:@"pluginspage"]
                                                          pluginName:[pluginPackage name]
     }
 
     if(!view){
-        WebPluginError *error = [WebPluginError pluginErrorWithCode:WebKitErrorJavaUnavailable
+        WebPlugInError *error = [WebPlugInError pluginErrorWithCode:WebKitErrorJavaUnavailable
                                                          contentURL:nil
                                                       pluginPageURL:nil
                                                          pluginName:[pluginPackage name]
index c4c2a80..952a2c8 100644 (file)
@@ -54,7 +54,7 @@ static WebDefaultResourceLoadDelegate *sharedDelegate = nil;
 {
 }
 
-- (void)webView: (WebView *)wv pluginFailedWithError:(WebPluginError *)error dataSource:(WebDataSource *)dataSource
+- (void)webView: (WebView *)wv plugInFailedWithError:(WebPlugInError *)error dataSource:(WebDataSource *)dataSource
 {
 }
 
index fb2a8ff..62271f6 100644 (file)
@@ -147,13 +147,13 @@ extern NSString *WebPreferencesChangedNotification;
     @method userStyleSheetLocation
     @discussion The user style sheet is stored as a URL string, e.g. "file://<etc>"
 */
-- (NSString *)userStyleSheetLocation;
+- (NSURL *)userStyleSheetLocation;
 
 /*!
     @method setUserStyleSheetLocation:
     @param string
 */
-- (void)setUserStyleSheetLocation:(NSString *)string;
+- (void)setUserStyleSheetLocation:(NSURL *)string;
 
 /*!
     @method JavaEnabled
index 19ab54e..8784097 100644 (file)
@@ -258,14 +258,14 @@ NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotificatio
     [self _setBoolValue: flag forKey: WebKitUserStyleSheetEnabledPreferenceKey];
 }
 
-- (NSString *)userStyleSheetLocation
+- (NSURL *)userStyleSheetLocation
 {
-    return [self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey];
+    return [NSURL URLWithString:[self _stringValueForKey: WebKitUserStyleSheetLocationPreferenceKey]];
 }
 
-- (void)setUserStyleSheetLocation:(NSString *)string
+- (void)setUserStyleSheetLocation:(NSURL *)URL
 {
-    [self _setStringValue: string forKey: WebKitUserStyleSheetLocationPreferenceKey];
+    [self _setStringValue: [URL absoluteString] forKey: WebKitUserStyleSheetLocationPreferenceKey];
 }
 
 - (BOOL)JavaEnabled
index d8b6f15..b8011c3 100644 (file)
@@ -6,7 +6,7 @@
 */
 @class WebView;
 @class WebDataSource;
-@class WebPluginError;
+@class WebPlugInError;
 @class WebResponse;
 @class NSURLRequest;
 
      @param error The plug-in error.
      @param dataSource The dataSource that contains the plug-in.
 */
-- (void)webView:(WebView *)sender pluginFailedWithError:(WebPluginError *)error dataSource:(WebDataSource *)dataSource;
+- (void)webView:(WebView *)sender plugInFailedWithError:(WebPlugInError *)error dataSource:(WebDataSource *)dataSource;
 
 @end
 
index f84fa76..b1f9c34 100644 (file)
     [_private->settings setWillLoadImagesAutomatically:[preferences willLoadImagesAutomatically]];
 
     if ([preferences userStyleSheetEnabled]) {
-        [_private->settings setUserStyleSheetLocation:[preferences userStyleSheetLocation]];
+        [_private->settings setUserStyleSheetLocation:[[preferences userStyleSheetLocation] absoluteString]];
     } else {
         [_private->settings setUserStyleSheetLocation:@""];
     }