[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:40:17 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 5b3a514600fa4b2634ed560ed3f6f7961d3739da
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun May 4 22:08:59 2003 +0000

            Reviewed by John.
    
            - added validation to "Interface Builder" methods on WebView
    
            * WebView.subproj/WebView.h: Add NSUserInterfaceValidations protocol so that subclassers
            know that they can call [super validateUserInterfaceItem:].
            * WebView.subproj/WebView.m:
            (-[WebView canMakeTextSmaller]): Simplify.
            (-[WebView canMakeTextLarger]): Simplify.
            (-[WebView _isLoading]): Added.
            (-[WebView validateUserInterfaceItem:]): Added. Checks for the six actions we implement,
            and returns NO if they are not valid.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4271 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 878c1d5..2a7c87f 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2003-05-04  Darin Adler  <darin at apple.com>
+
+        Reviewed by John.
+
+        - added validation to "Interface Builder" methods on WebView
+
+        * WebView.subproj/WebView.h: Add NSUserInterfaceValidations protocol so that subclassers
+        know that they can call [super validateUserInterfaceItem:].
+        * WebView.subproj/WebView.m:
+        (-[WebView canMakeTextSmaller]): Simplify.
+        (-[WebView canMakeTextLarger]): Simplify.
+        (-[WebView _isLoading]): Added.
+        (-[WebView validateUserInterfaceItem:]): Added. Checks for the six actions we implement,
+        and returns NO if they are not valid.
+
 2003-05-02  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by Richard.
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index f1ec978..9c42528 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -359,7 +359,7 @@ extern NSString *WebElementLinkLabelKey;	// NSString of the text within the anch
 @end
 
 
- at interface WebView (WebIBActions)
+ at interface WebView (WebIBActions) <NSUserInterfaceValidations>
 - (IBAction)takeStringURLFrom:(id)sender;
 - (IBAction)stopLoading:(id)sender;
 - (IBAction)reload:(id)sender;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index f67eca1..8fdfa64 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -578,7 +578,6 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     [[WebDataSource _repTypes] setObject:representationClass forKey:MIMEType];
 }
 
-
 @end
 
 
@@ -627,7 +626,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (BOOL)canMakeTextSmaller
 {
-    if ([[[[self mainFrame] dataSource] request] URL] == nil) {
+    if ([[self mainFrame] dataSource] == nil) {
         return NO;
     }
     if ([self textSizeMultiplier]/TextSizeMultiplierRatio < MinimumTextSizeMultiplier) {
@@ -638,7 +637,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
 
 - (BOOL)canMakeTextLarger
 {
-    if ([[[[self mainFrame] dataSource] request] URL] == nil) {
+    if ([[self mainFrame] dataSource] == nil) {
         return NO;
     }
     if ([self textSizeMultiplier]*TextSizeMultiplierRatio > MaximumTextSizeMultiplier) {
@@ -663,5 +662,32 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     [self setTextSizeMultiplier:[self textSizeMultiplier]*TextSizeMultiplierRatio];
 }
 
- at end
+- (BOOL)_isLoading
+{
+    WebFrame *mainFrame = [self mainFrame];
+    return [[mainFrame dataSource] isLoading]
+        || [[mainFrame provisionalDataSource] isLoading];
+}
+
+- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
+{
+    SEL action = [item action];
 
+    if (action == @selector(goBack:)) {
+	return [self canGoBack];
+    } else if (action == @selector(goForward:)) {
+	return [self canGoForward];
+    } else if (action == @selector(makeTextLarger:)) {
+	return [self canMakeTextLarger];
+    } else if (action == @selector(makeTextSmaller:)) {
+	return [self canMakeTextSmaller];
+    } else if (action == @selector(reload:)) {
+	return [[self mainFrame] dataSource] != nil;
+    } else if (action == @selector(stopLoading:)) {
+	return [self _isLoading];
+    }
+
+    return YES;
+}
+
+ at end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list