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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:27:11 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit b7c5c0806d41b7a88be8dbd381917454d95be043
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Mar 4 06:50:39 2003 +0000

    WebKit:
    
            Reviewed by Richard.
    
            - simplified the custom user agent and text encoding methods as per request from documentation group
    
            * WebView.subproj/WebController.h: Removed hasCustomUserAgent, resetUserAgent, hasCustomTextEncoding,
            and resetTextEncoding. Updated comments to indicate what nil means.
    
            * WebView.subproj/WebController.m:
            (-[WebController setCustomUserAgent:]): Remove assertion, allow nil.
            (-[WebController customUserAgent]): Remove nil check.
            (-[WebController setCustomTextEncodingName:]): Remove assertion, allow nil, and do an == check along
            with the isEqualToString: check to handle the nil case.
            (-[WebController customTextEncodingName]): Remove nil check.
    
    WebBrowser:
    
            Reviewed by Richard.
    
            - updated for WebKit API changes
    
            * BrowserWindowController.m:
            (-[BrowserWindowController validateMenuItem:]): Use customTextEncodingName of nil to detect
            lack of custom text encoding, rather than hasCustomTextEncoding.
            (-[BrowserWindowController changeTextEncoding:]): Use setCustomTextEncodingName:nil to reset
            custom text encoding rather than resetTextEncoding.
    
            * Debug/DebugUtilities.m:
            (-[BrowserDocument setUserAgent:]): Just use isEqualToString: with the user agent as the
            responder because it now returns nil when there is none.
            (-[BrowserDocument validate_setUserAgent:]): Ditto.
            (-[BrowserDocument resetUserAgent:]): Use customUserAgent instead of hasCustomUserAgent,
            and use setCustomUserAgent:nil instead of resetUserAgent.
            (-[BrowserDocument validate_resetUserAgent:]): More of the same.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3739 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index cf77a6c..778aa39 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,19 @@
+2003-03-03  Darin Adler  <darin at apple.com>
+
+        Reviewed by Richard.
+
+        - simplified the custom user agent and text encoding methods as per request from documentation group
+
+        * WebView.subproj/WebController.h: Removed hasCustomUserAgent, resetUserAgent, hasCustomTextEncoding,
+        and resetTextEncoding. Updated comments to indicate what nil means.
+        
+        * WebView.subproj/WebController.m:
+        (-[WebController setCustomUserAgent:]): Remove assertion, allow nil.
+        (-[WebController customUserAgent]): Remove nil check.
+        (-[WebController setCustomTextEncodingName:]): Remove assertion, allow nil, and do an == check along
+        with the isEqualToString: check to handle the nil case.
+        (-[WebController customTextEncodingName]): Remove nil check.
+
 2003-03-01  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Darin.
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index ae092e3..57018bc 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -294,31 +294,16 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
     @method setCustomUserAgent:
     @abstract Set the user agent. 
     @discussion Setting this means that the controller should use this user-agent string
-    instead of constructing a user-agent string for each URL.
+    instead of constructing a user-agent string for each URL. Setting it to nil
+    causes the controller to construct the user-agent string for each URL
+    for best results rendering web pages.
     @param userAgentString The user agent description
 */
 - (void)setCustomUserAgent:(NSString *)userAgentString;
 
 /*!
-    @method resetUserAgent
-    @abstract Reset the user agent. 
-    @discussion Causes the controller to construct the user-agent string for each URL
-    for best results rendering web pages.
-*/
-- (void)resetUserAgent;
-
-/*!
-    @method hasCustomUserAgent
-    @abstract Determine whether or not a custom user-agent string is in use.
-    @discussion It's an error to call customUserAgent if hasCustomUserAgent is NO.
-    @result YES if a custom user agent has been set, NO otherwise.
-*/
-- (BOOL)hasCustomUserAgent;
-
-/*!
     @method customUserAgent
-    @result The custom user-agent string. Should only be called
-    if hasCustomUserAgent returns YES.
+    @result The custom user-agent string or nil if no custom user-agent string has been set.
 */
 - (NSString *)customUserAgent;
 
@@ -345,27 +330,14 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
     what's specified in a web page's header or HTTP response.
     The text encoding automatically goes back to the default when the top level frame
     changes to a new location.
-    @param encoding The text encoding to use to display a page.
-*/
-- (void)setCustomTextEncodingName:(NSString *)encoding;
-
-/*!
-    @method resetTextEncoding
-    @abstract Remove any custom encodings that have been applied and use the default encoding.
-*/
-- (void)resetTextEncoding;
-
-/*!
-    @method hasCustomTextEncoding
-    @abstract Determine whether or not a custom text encoding is in use.
-    @discussion It's an error to call customTextEncoding if hasCustomTextEncoding is NO.
-    @result YES if a custom encoding has been set, NO otherwise.
+    Setting the text encoding name to nil makes the controller use default encoding rules.
+    @param encoding The text encoding name to use to display a page or nil.
 */
-- (BOOL)hasCustomTextEncoding;
+- (void)setCustomTextEncodingName:(NSString *)encodingName;
 
 /*!
-    @method customTextEncoding
-    @result The custom text encoding.
+    @method customTextEncodingName
+    @result The custom text encoding name or nil if no custom text encoding name has been set.
 */
 - (NSString *)customTextEncodingName;
 
diff --git a/WebKit/WebView.subproj/WebController.m b/WebKit/WebView.subproj/WebController.m
index 89b8bd2..259abab 100644
--- a/WebKit/WebView.subproj/WebController.m
+++ b/WebKit/WebView.subproj/WebController.m
@@ -351,30 +351,13 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
 
 - (void)setCustomUserAgent:(NSString *)userAgentString
 {
-    ASSERT_ARG(userAgentString, userAgentString);
-    
     NSString *override = [userAgentString copy];
     [_private->userAgentOverride release];
     _private->userAgentOverride = override;
 }
 
-- (void)resetUserAgent
-{
-    [_private->userAgentOverride release];
-    _private->userAgentOverride = nil;
-}
-
-- (BOOL)hasCustomUserAgent
-{
-    return _private->userAgentOverride != nil;
-}
-
 - (NSString *)customUserAgent
 {
-    if (_private->userAgentOverride == nil) {
-        ERROR("must not ask for customUserAgent is hasCustomUserAgent is NO");
-    }
-
     return [[_private->userAgentOverride retain] autorelease];
 }
 
@@ -483,24 +466,13 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
 
 - (void)setCustomTextEncodingName:(NSString *)encoding
 {
-    ASSERT_ARG(encoding, encoding);
-    
-    if ([self hasCustomTextEncoding] && [encoding isEqualToString:[self customTextEncodingName]]) {
+    NSString *oldEncoding = [self customTextEncodingName];
+    if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
         return;
     }
-
     [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
 }
 
-- (void)resetTextEncoding
-{
-    if (![self hasCustomTextEncoding]) {
-        return;
-    }
-    
-    [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:nil];
-}
-
 - (NSString *)_mainFrameOverrideEncoding
 {
     WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
@@ -513,20 +485,9 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
     return [dataSource _overrideEncoding];
 }
 
-- (BOOL)hasCustomTextEncoding
-{
-    return [self _mainFrameOverrideEncoding] != nil;
-}
-
 - (NSString *)customTextEncodingName
 {
-    NSString *result = [self _mainFrameOverrideEncoding];
-    
-    if (result == nil) {
-        ERROR("must not ask for customTextEncoding is hasCustomTextEncoding is NO");
-    }
-
-    return result;
+    return [self _mainFrameOverrideEncoding];
 }
 
 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index ae092e3..57018bc 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -294,31 +294,16 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
     @method setCustomUserAgent:
     @abstract Set the user agent. 
     @discussion Setting this means that the controller should use this user-agent string
-    instead of constructing a user-agent string for each URL.
+    instead of constructing a user-agent string for each URL. Setting it to nil
+    causes the controller to construct the user-agent string for each URL
+    for best results rendering web pages.
     @param userAgentString The user agent description
 */
 - (void)setCustomUserAgent:(NSString *)userAgentString;
 
 /*!
-    @method resetUserAgent
-    @abstract Reset the user agent. 
-    @discussion Causes the controller to construct the user-agent string for each URL
-    for best results rendering web pages.
-*/
-- (void)resetUserAgent;
-
-/*!
-    @method hasCustomUserAgent
-    @abstract Determine whether or not a custom user-agent string is in use.
-    @discussion It's an error to call customUserAgent if hasCustomUserAgent is NO.
-    @result YES if a custom user agent has been set, NO otherwise.
-*/
-- (BOOL)hasCustomUserAgent;
-
-/*!
     @method customUserAgent
-    @result The custom user-agent string. Should only be called
-    if hasCustomUserAgent returns YES.
+    @result The custom user-agent string or nil if no custom user-agent string has been set.
 */
 - (NSString *)customUserAgent;
 
@@ -345,27 +330,14 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
     what's specified in a web page's header or HTTP response.
     The text encoding automatically goes back to the default when the top level frame
     changes to a new location.
-    @param encoding The text encoding to use to display a page.
-*/
-- (void)setCustomTextEncodingName:(NSString *)encoding;
-
-/*!
-    @method resetTextEncoding
-    @abstract Remove any custom encodings that have been applied and use the default encoding.
-*/
-- (void)resetTextEncoding;
-
-/*!
-    @method hasCustomTextEncoding
-    @abstract Determine whether or not a custom text encoding is in use.
-    @discussion It's an error to call customTextEncoding if hasCustomTextEncoding is NO.
-    @result YES if a custom encoding has been set, NO otherwise.
+    Setting the text encoding name to nil makes the controller use default encoding rules.
+    @param encoding The text encoding name to use to display a page or nil.
 */
-- (BOOL)hasCustomTextEncoding;
+- (void)setCustomTextEncodingName:(NSString *)encodingName;
 
 /*!
-    @method customTextEncoding
-    @result The custom text encoding.
+    @method customTextEncodingName
+    @result The custom text encoding name or nil if no custom text encoding name has been set.
 */
 - (NSString *)customTextEncodingName;
 
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 89b8bd2..259abab 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -351,30 +351,13 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
 
 - (void)setCustomUserAgent:(NSString *)userAgentString
 {
-    ASSERT_ARG(userAgentString, userAgentString);
-    
     NSString *override = [userAgentString copy];
     [_private->userAgentOverride release];
     _private->userAgentOverride = override;
 }
 
-- (void)resetUserAgent
-{
-    [_private->userAgentOverride release];
-    _private->userAgentOverride = nil;
-}
-
-- (BOOL)hasCustomUserAgent
-{
-    return _private->userAgentOverride != nil;
-}
-
 - (NSString *)customUserAgent
 {
-    if (_private->userAgentOverride == nil) {
-        ERROR("must not ask for customUserAgent is hasCustomUserAgent is NO");
-    }
-
     return [[_private->userAgentOverride retain] autorelease];
 }
 
@@ -483,24 +466,13 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
 
 - (void)setCustomTextEncodingName:(NSString *)encoding
 {
-    ASSERT_ARG(encoding, encoding);
-    
-    if ([self hasCustomTextEncoding] && [encoding isEqualToString:[self customTextEncodingName]]) {
+    NSString *oldEncoding = [self customTextEncodingName];
+    if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding]) {
         return;
     }
-
     [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:encoding];
 }
 
-- (void)resetTextEncoding
-{
-    if (![self hasCustomTextEncoding]) {
-        return;
-    }
-    
-    [[self mainFrame] _reloadAllowingStaleDataWithOverrideEncoding:nil];
-}
-
 - (NSString *)_mainFrameOverrideEncoding
 {
     WebDataSource *dataSource = [[self mainFrame] provisionalDataSource];
@@ -513,20 +485,9 @@ NSString *WebElementLinkTitleKey = 		@"WebElementLinkTitle";
     return [dataSource _overrideEncoding];
 }
 
-- (BOOL)hasCustomTextEncoding
-{
-    return [self _mainFrameOverrideEncoding] != nil;
-}
-
 - (NSString *)customTextEncodingName
 {
-    NSString *result = [self _mainFrameOverrideEncoding];
-    
-    if (result == nil) {
-        ERROR("must not ask for customTextEncoding is hasCustomTextEncoding is NO");
-    }
-
-    return result;
+    return [self _mainFrameOverrideEncoding];
 }
 
 - (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list