[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

hyatt at apple.com hyatt at apple.com
Wed Dec 22 18:19:33 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fbba25f62b84f277ceb484922792a2e589815aa1
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 9 21:49:44 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=48545, Home/End, PgUp, PgDown should respect
    writing-mode.  This first part of the patch just patches Mac WebKit 1 views.
    
    Reviewed by Dan Bernstein.
    
    * WebView/WebFrameView.mm:
    (-[WebFrameView _isVerticalDocument]):
    (-[WebFrameView _isFlippedDocument]):
    (-[WebFrameView _scrollToEndOfDocument]):
    (-[WebFrameView _pageInBlockProgressionDirection:]):
    (-[WebFrameView scrollPageUp:]):
    (-[WebFrameView scrollPageDown:]):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73645 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index dae9653..61c16fd 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,18 @@
+2010-12-09  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        https://bugs.webkit.org/show_bug.cgi?id=48545, Home/End, PgUp, PgDown should respect
+        writing-mode.  This first part of the patch just patches Mac WebKit 1 views.
+
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _isVerticalDocument]):
+        (-[WebFrameView _isFlippedDocument]):
+        (-[WebFrameView _scrollToEndOfDocument]):
+        (-[WebFrameView _pageInBlockProgressionDirection:]):
+        (-[WebFrameView scrollPageUp:]):
+        (-[WebFrameView scrollPageDown:]):
+
 2010-12-08  Andy Estes  <aestes at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index 20905d0..82efa6d 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -529,6 +529,35 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     return frame->eventHandler()->scrollOverflow(direction, granularity);
 }
 
+
+- (BOOL)_isVerticalDocument
+{
+    Frame* coreFrame = [self _web_frame];
+    if (!coreFrame)
+        return YES;
+    Document* document = coreFrame->document();
+    if (!document)
+        return YES;
+    RenderObject* renderView = document->renderer();
+    if (!renderView)
+        return YES;
+    return renderView->style()->isHorizontalWritingMode();
+}
+
+- (BOOL)_isFlippedDocument
+{
+    Frame* coreFrame = [self _web_frame];
+    if (!coreFrame)
+        return NO;
+    Document* document = coreFrame->document();
+    if (!document)
+        return NO;
+    RenderObject* renderView = document->renderer();
+    if (!renderView)
+        return NO;
+    return renderView->style()->isFlippedBlocksWritingMode();
+}
+
 - (BOOL)_scrollToBeginningOfDocument
 {
     if ([self _scrollOverflowInDirection:ScrollUp granularity:ScrollByDocument])
@@ -548,9 +577,28 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     if (![self _isScrollable])
         return NO;
     NSRect frame = [[[self _scrollView] documentView] frame];
-    NSPoint point = NSMakePoint(frame.origin.x, NSMaxY(frame));
-    point.x += [[self _scrollView] scrollOrigin].x;
-    point.y += [[self _scrollView] scrollOrigin].y;
+    
+    bool isVertical = [self _isVerticalDocument];
+    bool isFlipped = [self _isFlippedDocument];
+
+    NSPoint point;
+    if (isVertical) {
+        if (!isFlipped)
+            point = NSMakePoint(frame.origin.x, NSMaxY(frame));
+        else
+            point = NSMakePoint(frame.origin.x, NSMinY(frame));
+    } else {
+        if (!isFlipped)
+            point = NSMakePoint(NSMaxX(frame), frame.origin.y);
+        else
+            point = NSMakePoint(NSMinX(frame), frame.origin.y);
+    }
+    
+    // Reset the position opposite to the block progression direction.
+    if (isVertical)
+        point.x += [[self _scrollView] scrollOrigin].x;
+    else
+        point.y += [[self _scrollView] scrollOrigin].y;
     return [[self _contentView] _scrollTo:&point animate:YES];
 }
 
@@ -643,6 +691,16 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     return [self _scrollHorizontallyBy:left ? -delta : delta];
 }
 
+- (BOOL)_pageInBlockProgressionDirection:(BOOL)forward
+{
+    // Determine whether we're calling _pageVertically or _pageHorizontally.
+    BOOL isVerticalDocument = [self _isVerticalDocument];
+    BOOL isFlippedBlock = [self _isFlippedDocument];
+    if (isVerticalDocument)
+        return [self _pageVertically:isFlippedBlock ? !forward : forward];
+    return [self _pageHorizontally:isFlippedBlock ? !forward : forward];
+}
+
 - (BOOL)_scrollLineVertically:(BOOL)up
 {
     if ([self _scrollOverflowInDirection:up ? ScrollUp : ScrollDown granularity:ScrollByLine])
@@ -669,7 +727,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (void)scrollPageUp:(id)sender
 {
-    if (![self _pageVertically:YES]) {
+    if (![self _pageInBlockProgressionDirection:YES]) {
         // If we were already at the top, tell the next responder to scroll if it can.
         [[self nextResponder] tryToPerform:@selector(scrollPageUp:) with:sender];
     }
@@ -677,7 +735,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (void)scrollPageDown:(id)sender
 {
-    if (![self _pageVertically:NO]) {
+    if (![self _pageInBlockProgressionDirection:NO]) {
         // If we were already at the bottom, tell the next responder to scroll if it can.
         [[self nextResponder] tryToPerform:@selector(scrollPageDown:) with:sender];
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list