Commit 28d2a9c3 authored by adele@apple.com's avatar adele@apple.com

2009-04-19 Adele Peterson <adele@apple.com>

        Reviewed by Darin Adler.

        Fix for <rdar://problem/6804809> REGRESSION: In Mail, Home and End do not scroll message

        If no scrolling occurs, call tryToPerform on the next responder.  Then our WebResponderChainSink
        will correctly detect if no responders handle the selector.

        * WebView/WebFrameView.mm:
        (-[WebFrameView _scrollToBeginningOfDocument]):
        (-[WebFrameView _scrollToEndOfDocument]):
        (-[WebFrameView scrollToBeginningOfDocument:]):
        (-[WebFrameView scrollToEndOfDocument:]):
        (-[WebFrameView scrollLineUp:]):
        (-[WebFrameView scrollLineDown:]):



git-svn-id: svn://svn.chromium.org/blink/trunk@42668 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6f490278
2009-04-19 Adele Peterson <adele@apple.com>
Reviewed by Darin Adler.
Fix for <rdar://problem/6804809> REGRESSION: In Mail, Home and End do not scroll message
If no scrolling occurs, call tryToPerform on the next responder. Then our WebResponderChainSink
will correctly detect if no responders handle the selector.
* WebView/WebFrameView.mm:
(-[WebFrameView _scrollToBeginningOfDocument]):
(-[WebFrameView _scrollToEndOfDocument]):
(-[WebFrameView scrollToBeginningOfDocument:]):
(-[WebFrameView scrollToEndOfDocument:]):
(-[WebFrameView scrollLineUp:]):
(-[WebFrameView scrollLineDown:]):
2009-04-19 David Kilzer <ddkilzer@apple.com> 2009-04-19 David Kilzer <ddkilzer@apple.com>
Make FEATURE_DEFINES completely dynamic Make FEATURE_DEFINES completely dynamic
......
...@@ -519,31 +519,49 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl ...@@ -519,31 +519,49 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
return frame->eventHandler()->scrollOverflow(direction, granularity); return frame->eventHandler()->scrollOverflow(direction, granularity);
} }
- (void)scrollToBeginningOfDocument:(id)sender - (BOOL)_scrollToBeginningOfDocument
{ {
if (![self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument]) { if ([self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument])
return YES;
if (![self _hasScrollBars])
return NO;
NSPoint point = [[[self _scrollView] documentView] frame].origin;
return [[self _contentView] _scrollTo:&point animate:YES];
}
if (![self _hasScrollBars]) { - (BOOL)_scrollToEndOfDocument
[[self _largestChildWithScrollBars] scrollToBeginningOfDocument:sender]; {
return; if ([self _scrollOverflowInDirection:ScrollDown granularity:ScrollByDocument])
} return YES;
if (![self _hasScrollBars])
return NO;
NSRect frame = [[[self _scrollView] documentView] frame];
NSPoint point = NSMakePoint(frame.origin.x, NSMaxY(frame));
return [[self _contentView] _scrollTo:&point animate:YES];
}
[[self _contentView] scrollPoint:[[[self _scrollView] documentView] frame].origin]; - (void)scrollToBeginningOfDocument:(id)sender
{
if ([self _scrollToBeginningOfDocument])
return;
if (WebFrameView *child = [self _largestChildWithScrollBars]) {
if ([child _scrollToBeginningOfDocument])
return;
} }
[[self nextResponder] tryToPerform:@selector(scrollToBeginningOfDocument:) with:sender];
} }
- (void)scrollToEndOfDocument:(id)sender - (void)scrollToEndOfDocument:(id)sender
{ {
if (![self _scrollOverflowInDirection:ScrollDown granularity:ScrollByDocument]) { if ([self _scrollToEndOfDocument])
return;
if (![self _hasScrollBars]) { if (WebFrameView *child = [self _largestChildWithScrollBars]) {
[[self _largestChildWithScrollBars] scrollToEndOfDocument:sender]; if ([child _scrollToEndOfDocument])
return; return;
}
NSRect frame = [[[self _scrollView] documentView] frame];
[[self _contentView] scrollPoint:NSMakePoint(frame.origin.x, NSMaxY(frame))];
} }
[[self nextResponder] tryToPerform:@selector(scrollToEndOfDocument:) with:sender];
} }
- (void)_goBack - (void)_goBack
...@@ -654,12 +672,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl ...@@ -654,12 +672,14 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
- (void)scrollLineUp:(id)sender - (void)scrollLineUp:(id)sender
{ {
[self _scrollLineVertically:YES]; if (![self _scrollLineVertically:YES])
[[self nextResponder] tryToPerform:@selector(scrollLineUp:) with:sender];
} }
- (void)scrollLineDown:(id)sender - (void)scrollLineDown:(id)sender
{ {
[self _scrollLineVertically:NO]; if (![self _scrollLineVertically:NO])
[[self nextResponder] tryToPerform:@selector(scrollLineDown:) with:sender];
} }
- (BOOL)_firstResponderIsFormControl - (BOOL)_firstResponderIsFormControl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment