[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 06:47:33 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 03f49afe2a9cb647dcfec6b420f723fa03e6572e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 7 20:29:18 2002 +0000

    WebCore:
    
    	- fixed 3011025 -- Page up/down is not working when text area has focus
    
            * kwq/KWQTextArea.mm:
            (-[KWQTextArea needsPanelToBecomeKey]): Return YES so we are considered a
    	valid key view even when in normal tabbing mode. This fixes a problem with
    	tabbing backwards into a text area.
            (-[KWQTextAreaTextView scrollPageUp:]): Added. Passes a scrollPageUp:
    	selector along the responder chain if we are already scrolled to the top.
            (-[KWQTextAreaTextView scrollPageDown:]): Ditto.
    
            * kwq/KWQNSTextField.mm: Remove unnecessary overrides of textDidEndEditing.
    	Turns out the real fix was to override display to do nothing as a workaround
    	for bug 2753974.
    
    WebKit:
    
    	WebKit part of the page up/down fix.
    
            * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView scrollPoint:]):
    	If we are called from the handling of a page up or page down keyboard
    	event, then ignore the specific scrolling requested, and do our idea of
    	page up and page down. This guarantees that we will get the smarter
    	idea of how to page from WebView instead of the one that's hardcoded
    	into NSTextView.
    
            * WebView.subproj/WebView.m: (-[WebView keyDown:]): Use scrollPageUp:,
    	scrollPageDown:, scrollLineUp:, and scrollLineDown: instead of _pageUp,
    	_pageDown, _lineUp, and _lineDown. This lets other classes see and use
    	these selectors, which is useful when passing calls up the responder chain.
            * WebView.subproj/WebViewPrivate.h: Remove the private methods that are
    	being changed to match the NSResponder keyboard methods.
            * WebView.subproj/WebViewPrivate.m:
            (-[WebView scrollPageUp:]): Rename from _pageUp, and also pass a scrollPageUp:
    	selector along the responder chain if we are already scrolled to the top.
            (-[WebView scrollPageDown:]): Ditto.
            (-[WebView scrollLineUp:]): Rename from _lineUp.
            (-[WebView scrollLineDown:]): Rename from _lineDown.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 07ea2d0..47da0b6 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,19 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	- fixed 3011025 -- Page up/down is not working when text area has focus
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea needsPanelToBecomeKey]): Return YES so we are considered a
+	valid key view even when in normal tabbing mode. This fixes a problem with
+	tabbing backwards into a text area.
+        (-[KWQTextAreaTextView scrollPageUp:]): Added. Passes a scrollPageUp:
+	selector along the responder chain if we are already scrolled to the top.
+        (-[KWQTextAreaTextView scrollPageDown:]): Ditto.
+
+        * kwq/KWQNSTextField.mm: Remove unnecessary overrides of textDidEndEditing.
+	Turns out the real fix was to override display to do nothing as a workaround
+	for bug 2753974.
+
 2002-10-07  Richard Williamson   <rjw at apple.com>
 
         Added response to WebCore's CachedObject.  This allows us to correctly
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 07ea2d0..47da0b6 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,19 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	- fixed 3011025 -- Page up/down is not working when text area has focus
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea needsPanelToBecomeKey]): Return YES so we are considered a
+	valid key view even when in normal tabbing mode. This fixes a problem with
+	tabbing backwards into a text area.
+        (-[KWQTextAreaTextView scrollPageUp:]): Added. Passes a scrollPageUp:
+	selector along the responder chain if we are already scrolled to the top.
+        (-[KWQTextAreaTextView scrollPageDown:]): Ditto.
+
+        * kwq/KWQNSTextField.mm: Remove unnecessary overrides of textDidEndEditing.
+	Turns out the real fix was to override display to do nothing as a workaround
+	for bug 2753974.
+
 2002-10-07  Richard Williamson   <rjw at apple.com>
 
         Added response to WebCore's CachedObject.  This allows us to correctly
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 07ea2d0..47da0b6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	- fixed 3011025 -- Page up/down is not working when text area has focus
+
+        * kwq/KWQTextArea.mm:
+        (-[KWQTextArea needsPanelToBecomeKey]): Return YES so we are considered a
+	valid key view even when in normal tabbing mode. This fixes a problem with
+	tabbing backwards into a text area.
+        (-[KWQTextAreaTextView scrollPageUp:]): Added. Passes a scrollPageUp:
+	selector along the responder chain if we are already scrolled to the top.
+        (-[KWQTextAreaTextView scrollPageDown:]): Ditto.
+
+        * kwq/KWQNSTextField.mm: Remove unnecessary overrides of textDidEndEditing.
+	Turns out the real fix was to override display to do nothing as a workaround
+	for bug 2753974.
+
 2002-10-07  Richard Williamson   <rjw at apple.com>
 
         Added response to WebCore's CachedObject.  This allows us to correctly
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index 3aed0fd..a2dfa14 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -248,32 +248,11 @@
     return [super becomeFirstResponder];
 }
 
-- (void)textDidEndEditing:(NSNotification *)notification
-{
-    // If we are tabbing nowhere, we don't want to flash as we deselect and reselect.
-    // So we handle those cases here and don't call super.
-    switch ([[[notification userInfo] objectForKey:@"NSTextMovement"] intValue]) {
-        case NSTabTextMovement:
-            if (![self nextValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-        case NSBacktabTextMovement:
-            if (![self previousValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-    }
-    
-    [super textDidEndEditing:notification];
-}
-
 - (void)display
 {
+    // This is a workaround for Radar 2753974.
+    // Also, in the web page context, it's never OK to just display.
+    [self setNeedsDisplay:YES];
 }
 
 @end
@@ -389,32 +368,11 @@
     return [super becomeFirstResponder];
 }
 
-- (void)textDidEndEditing:(NSNotification *)notification
-{
-    // If we are tabbing nowhere, we don't want to flash as we deselect and reselect.
-    // So we handle those cases here and don't call super.
-    switch ([[[notification userInfo] objectForKey:@"NSTextMovement"] intValue]) {
-        case NSTabTextMovement:
-            if (![self nextValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-        case NSBacktabTextMovement:
-            if (![self previousValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-    }
-    
-    [super textDidEndEditing:notification];
-}
-
 - (void)display
 {
+    // This is a workaround for Radar 2753974.
+    // Also, in the web page context, it's never OK to just display.
+    [self setNeedsDisplay:YES];
 }
 
 @end
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 422ff0c..59e7157 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -434,6 +434,12 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
     return view;
 }
 
+- (BOOL)needsPanelToBecomeKey
+{
+    // If we don't return YES here, tabbing backwards into this view doesn't work.
+    return YES;
+}
+
 @end
 
 @implementation KWQTextAreaTextView
@@ -471,4 +477,24 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
     return self == [[self window] firstResponder] ? [super selectedTextAttributes] : nil;
 }
 
+- (void)scrollPageUp:(id)sender
+{
+    // After hitting the top, tell our parent to scroll
+    float oldY = [[[self enclosingScrollView] contentView] bounds].origin.y;
+    [super scrollPageUp:sender];
+    if (oldY == [[[self enclosingScrollView] contentView] bounds].origin.y) {
+        [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:nil];
+    }
+}
+
+- (void)scrollPageDown:(id)sender
+{
+    // After hitting the bottom, tell our parent to scroll
+    float oldY = [[[self enclosingScrollView] contentView] bounds].origin.y;
+    [super scrollPageDown:sender];
+    if (oldY == [[[self enclosingScrollView] contentView] bounds].origin.y) {
+        [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:nil];
+    }
+}
+
 @end
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 3aed0fd..a2dfa14 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -248,32 +248,11 @@
     return [super becomeFirstResponder];
 }
 
-- (void)textDidEndEditing:(NSNotification *)notification
-{
-    // If we are tabbing nowhere, we don't want to flash as we deselect and reselect.
-    // So we handle those cases here and don't call super.
-    switch ([[[notification userInfo] objectForKey:@"NSTextMovement"] intValue]) {
-        case NSTabTextMovement:
-            if (![self nextValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-        case NSBacktabTextMovement:
-            if (![self previousValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-    }
-    
-    [super textDidEndEditing:notification];
-}
-
 - (void)display
 {
+    // This is a workaround for Radar 2753974.
+    // Also, in the web page context, it's never OK to just display.
+    [self setNeedsDisplay:YES];
 }
 
 @end
@@ -389,32 +368,11 @@
     return [super becomeFirstResponder];
 }
 
-- (void)textDidEndEditing:(NSNotification *)notification
-{
-    // If we are tabbing nowhere, we don't want to flash as we deselect and reselect.
-    // So we handle those cases here and don't call super.
-    switch ([[[notification userInfo] objectForKey:@"NSTextMovement"] intValue]) {
-        case NSTabTextMovement:
-            if (![self nextValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-        case NSBacktabTextMovement:
-            if (![self previousValidKeyView]) {
-                [self selectText:self];
-                [self _KWQ_scrollFrameToVisible];
-                return;
-            }
-            break;
-    }
-    
-    [super textDidEndEditing:notification];
-}
-
 - (void)display
 {
+    // This is a workaround for Radar 2753974.
+    // Also, in the web page context, it's never OK to just display.
+    [self setNeedsDisplay:YES];
 }
 
 @end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 2c41612..f0fb3e5 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,27 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	WebKit part of the page up/down fix.
+
+        * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView scrollPoint:]):
+	If we are called from the handling of a page up or page down keyboard
+	event, then ignore the specific scrolling requested, and do our idea of
+	page up and page down. This guarantees that we will get the smarter
+	idea of how to page from WebView instead of the one that's hardcoded
+	into NSTextView.
+
+        * WebView.subproj/WebView.m: (-[WebView keyDown:]): Use scrollPageUp:,
+	scrollPageDown:, scrollLineUp:, and scrollLineDown: instead of _pageUp,
+	_pageDown, _lineUp, and _lineDown. This lets other classes see and use
+	these selectors, which is useful when passing calls up the responder chain.
+        * WebView.subproj/WebViewPrivate.h: Remove the private methods that are
+	being changed to match the NSResponder keyboard methods.
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView scrollPageUp:]): Rename from _pageUp, and also pass a scrollPageUp:
+	selector along the responder chain if we are already scrolled to the top.
+        (-[WebView scrollPageDown:]): Ditto.
+        (-[WebView scrollLineUp:]): Rename from _lineUp.
+        (-[WebView scrollLineDown:]): Rename from _lineDown.
+
 2002-10-07  Richard Williamson   <rjw at apple.com>
 
         'Re'play the delegate messages when an item is loaded from
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 2c41612..f0fb3e5 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,27 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	WebKit part of the page up/down fix.
+
+        * WebView.subproj/WebHTMLViewPrivate.m: (-[WebHTMLView scrollPoint:]):
+	If we are called from the handling of a page up or page down keyboard
+	event, then ignore the specific scrolling requested, and do our idea of
+	page up and page down. This guarantees that we will get the smarter
+	idea of how to page from WebView instead of the one that's hardcoded
+	into NSTextView.
+
+        * WebView.subproj/WebView.m: (-[WebView keyDown:]): Use scrollPageUp:,
+	scrollPageDown:, scrollLineUp:, and scrollLineDown: instead of _pageUp,
+	_pageDown, _lineUp, and _lineDown. This lets other classes see and use
+	these selectors, which is useful when passing calls up the responder chain.
+        * WebView.subproj/WebViewPrivate.h: Remove the private methods that are
+	being changed to match the NSResponder keyboard methods.
+        * WebView.subproj/WebViewPrivate.m:
+        (-[WebView scrollPageUp:]): Rename from _pageUp, and also pass a scrollPageUp:
+	selector along the responder chain if we are already scrolled to the top.
+        (-[WebView scrollPageDown:]): Ditto.
+        (-[WebView scrollLineUp:]): Rename from _lineUp.
+        (-[WebView scrollLineDown:]): Rename from _lineDown.
+
 2002-10-07  Richard Williamson   <rjw at apple.com>
 
         'Re'play the delegate messages when an item is loaded from
diff --git a/WebKit/WebView.subproj/WebFrameView.m b/WebKit/WebView.subproj/WebFrameView.m
index 6a8e421..b6cea90 100644
--- a/WebKit/WebView.subproj/WebFrameView.m
+++ b/WebKit/WebView.subproj/WebFrameView.m
@@ -260,18 +260,18 @@ enum {
                 break;
             case SpaceKey:
                 if ([event modifierFlags] & NSShiftKeyMask) {
-                    [self _pageUp];
+                    [self scrollPageUp:nil];
                 } else {
-                    [self _pageDown];
+                    [self scrollPageDown:nil];
                 }
                 callSuper = NO;
                 break;
             case NSPageUpFunctionKey:
-                [self _pageUp];
+                [self scrollPageUp:nil];
                 callSuper = NO;
                 break;
             case NSPageDownFunctionKey:
-                [self _pageDown];
+                [self scrollPageDown:nil];
                 callSuper = NO;
                 break;
             case NSHomeFunctionKey:
@@ -286,9 +286,9 @@ enum {
                 if ([event modifierFlags] & NSCommandKeyMask) {
                     [self _scrollToTopLeft];
                 } else if ([event modifierFlags] & NSAlternateKeyMask) {
-                    [self _pageUp];
+                    [self scrollPageUp:nil];
                 } else {
-                    [self _lineUp];
+                    [self scrollLineUp:nil];
                 }
                 callSuper = NO;
                 break;
@@ -296,9 +296,9 @@ enum {
                 if ([event modifierFlags] & NSCommandKeyMask) {
                     [self _scrollToBottomLeft];
                 } else if ([event modifierFlags] & NSAlternateKeyMask) {
-                    [self _pageDown];
+                    [self scrollPageDown:nil];
                 } else {
-                    [self _lineDown];
+                    [self scrollLineDown:nil];
                 }
                 callSuper = NO;
                 break;
diff --git a/WebKit/WebView.subproj/WebFrameViewInternal.h b/WebKit/WebView.subproj/WebFrameViewInternal.h
index d4be327..b1eefd0 100644
--- a/WebKit/WebView.subproj/WebFrameViewInternal.h
+++ b/WebKit/WebView.subproj/WebFrameViewInternal.h
@@ -38,14 +38,10 @@
 - (NSClipView *)_contentView;
 - (void)_scrollLineVertically: (BOOL)up;
 - (void)_scrollLineHorizontally: (BOOL)left;
-- (void)_pageDown;
-- (void)_pageUp;
 - (void)_pageLeft;
 - (void)_pageRight;
 - (void)_scrollToTopLeft;
 - (void)_scrollToBottomLeft;
-- (void)_lineDown;
-- (void)_lineUp;
 - (void)_lineLeft;
 - (void)_lineRight;
 - (void)_goBack;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.h b/WebKit/WebView.subproj/WebFrameViewPrivate.h
index d4be327..b1eefd0 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.h
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.h
@@ -38,14 +38,10 @@
 - (NSClipView *)_contentView;
 - (void)_scrollLineVertically: (BOOL)up;
 - (void)_scrollLineHorizontally: (BOOL)left;
-- (void)_pageDown;
-- (void)_pageUp;
 - (void)_pageLeft;
 - (void)_pageRight;
 - (void)_scrollToTopLeft;
 - (void)_scrollToBottomLeft;
-- (void)_lineDown;
-- (void)_lineUp;
 - (void)_lineLeft;
 - (void)_lineRight;
 - (void)_goBack;
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index 51c8c7c..9f993a3 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -90,18 +90,14 @@
 
 - (void)_scrollVerticallyBy: (float)delta
 {
-    NSPoint point;
-
-    point = [[self _contentView] bounds].origin;
+    NSPoint point = [[self _contentView] bounds].origin;
     point.y += delta;
     [[self _contentView] scrollPoint: point];
 }
 
 - (void)_scrollHorizontallyBy: (float)delta
 {
-    NSPoint point;
-
-    point = [[self _contentView] bounds].origin;
+    NSPoint point = [[self _contentView] bounds].origin;
     point.x += delta;
     [[self _contentView] scrollPoint: point];
 }
@@ -122,7 +118,7 @@
     return [[self frameScrollView] horizontalLineScroll] * 4;
 }
 
-- (void)_pageVertically: (BOOL)up
+- (void)_pageVertically:(BOOL)up
 {
     float pageOverlap = [self _verticalKeyboardScrollAmount];
     float delta = [[self _contentView] bounds].size.height;
@@ -172,24 +168,34 @@
     [self _scrollHorizontallyBy: delta];
 }
 
-- (void)_pageDown
+- (void)scrollPageUp:(id)sender
 {
-    [self _pageVertically: NO];
+    // After hitting the top, tell our parent to scroll
+    float oldY = [[self _contentView] bounds].origin.y;
+    [self _pageVertically:YES];
+    if (oldY == [[self _contentView] bounds].origin.y) {
+        [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:nil];
+    }
 }
 
-- (void)_pageUp
+- (void)scrollPageDown:(id)sender
 {
-    [self _pageVertically: YES];
+    // After hitting the bottom, tell our parent to scroll
+    float oldY = [[self _contentView] bounds].origin.y;
+    [self _pageVertically:NO];
+    if (oldY == [[self _contentView] bounds].origin.y) {
+        [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:nil];
+    }
 }
 
 - (void)_pageLeft
 {
-    [self _pageHorizontally: YES];
+    [self _pageHorizontally:YES];
 }
 
 - (void)_pageRight
 {
-    [self _pageHorizontally: NO];
+    [self _pageHorizontally:NO];
 }
 
 - (void)_scrollToTopLeft
@@ -202,14 +208,14 @@
     [[self _contentView] scrollPoint: NSMakePoint(0, [[[self frameScrollView] documentView] bounds].size.height)];
 }
 
-- (void)_lineDown
+- (void)scrollLineUp:(id)sender
 {
-    [self _scrollLineVertically: NO];
+    [self _scrollLineVertically: YES];
 }
 
-- (void)_lineUp
+- (void)scrollLineDown:(id)sender
 {
-    [self _scrollLineVertically: YES];
+    [self _scrollLineVertically: NO];
 }
 
 - (void)_lineLeft
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 894e155..867428c 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -255,6 +255,29 @@ BOOL _modifierTrackingEnabled = FALSE;
     return NO;
 }
 
+- (void)scrollPoint:(NSPoint)point
+{
+    // Since we can't subclass NSTextView to do what we want, we have to second guess it here.
+    // If we get called during the handling of a key down event, we assume the call came from
+    // NSTextView, and ignore it and use our own code to decide how to page up and page down
+    // We are smarter about how far to scroll, and we have "superview scrolling" logic.
+    NSEvent *event = [[self window] currentEvent];
+    if ([event type] == NSKeyDown) {
+        const unichar pageUp = NSPageUpFunctionKey;
+        if ([[event characters] rangeOfString:[NSString stringWithCharacters:&pageUp length:1]].length == 1) {
+            [self tryToPerform:@selector(scrollPageUp:) with:nil];
+            return;
+        }
+        const unichar pageDown = NSPageDownFunctionKey;
+        if ([[event characters] rangeOfString:[NSString stringWithCharacters:&pageDown length:1]].length == 1) {
+            [self tryToPerform:@selector(scrollPageDown:) with:nil];
+            return;
+        }
+    }
+    
+    [super scrollPoint:point];
+}
+
 @end
 
 @implementation NSView (WebHTMLViewPrivate)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list