[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

mitz at apple.com mitz at apple.com
Wed Feb 10 22:13:49 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 231bd9b80ade7ba4cfd4f66ff8d2573965c00c84
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 4 17:35:58 2010 +0000

    REGRESSION (r53718): When scrolling a tall window by page, the overlap between pages is too big
    https://bugs.webkit.org/show_bug.cgi?id=34371
    
    Reviewed by Simon Fraser.
    
    WebCore:
    
    Allow ScrollbarTheme to cap the overlap between pages, and set a cap of
    40 in ScrollbarThemeMac.
    
    * WebCore.base.exp: Export Scrollbar::maxOverlapBetweenPages().
    * editing/EditorCommand.cpp:
    (WebCore::verticalScrollDistance): Use Scrollbar methods instead of
    constants, and cap the scroll distance if needed.
    * platform/ScrollView.cpp:
    (WebCore::ScrollView::updateScrollbars): Ditto.
    (WebCore::ScrollView::wheelEvent): Ditto.
    * platform/Scrollbar.cpp:
    (WebCore::Scrollbar::maxOverlapBetweenPages): Added. Returns the
    value from the native scrollbar theme.
    * platform/Scrollbar.h: Replaced scroll amount constants with static methods.
    (WebCore::Scrollbar::pixelsPerLineStep): Replaces cScrollbarPixelsPerLineStep.
    (WebCore::Scrollbar::minFractionToStepWhenPaging): Replaces cFractionToStepWhenPaging.
    * platform/ScrollbarTheme.h:
    (WebCore::ScrollbarTheme::maxOverlapBetweenPages): A base implementation
    that returns the largest int.
    * platform/gtk/WheelEventGtk.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
    constants.
    * platform/haiku/PlatformWheelEventHaiku.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
    constants.
    * platform/mac/ScrollbarThemeMac.h:
    (WebCore::ScrollbarThemeMac::maxOverlapBetweenPages): An override
    that returns 40.
    * platform/mac/WheelEventMac.mm:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use
    Scrollbar::pixelsPerLineStep() instead of cScrollbarPixelsPerLineStep.
    * platform/wx/MouseWheelEventWx.cpp:
    (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
    constants.
    * platform/wx/ScrollViewWx.cpp:
    (WebCore::ScrollView::ScrollViewPrivate::OnScrollWinEvents): Use Scrollbar
    methods instead of constants, and cap the scroll distance if needed.
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::updateScrollInfoAfterLayout): Ditto.
    
    WebKit/mac:
    
    * WebView/WebFrameView.mm:
    (-[WebFrameView _verticalPageScrollDistance]): Use Scrollbar methods instead of
    constants, and cap the scroll distance.
    (-[WebFrameView initWithFrame:]): Use Scrollbar::pixelsPerLineStep() instead of
    cScrollbarPixelsPerLineStep.
    (-[WebFrameView _horizontalPageScrollDistance]):Use Scrollbar methods instead of
    constants, and cap the scroll distance.
    
    WebKit/wx:
    
    * WebView.cpp:
    (wxWebView::OnKeyEvents): Use Scrollbar method instead of constant.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f3015a0..d466275 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,50 @@
+2010-02-04  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        REGRESSION (r53718): When scrolling a tall window by page, the overlap between pages is too big
+        https://bugs.webkit.org/show_bug.cgi?id=34371
+
+        Allow ScrollbarTheme to cap the overlap between pages, and set a cap of
+        40 in ScrollbarThemeMac.
+
+        * WebCore.base.exp: Export Scrollbar::maxOverlapBetweenPages().
+        * editing/EditorCommand.cpp:
+        (WebCore::verticalScrollDistance): Use Scrollbar methods instead of
+        constants, and cap the scroll distance if needed.
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::updateScrollbars): Ditto.
+        (WebCore::ScrollView::wheelEvent): Ditto.
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::maxOverlapBetweenPages): Added. Returns the
+        value from the native scrollbar theme.
+        * platform/Scrollbar.h: Replaced scroll amount constants with static methods.
+        (WebCore::Scrollbar::pixelsPerLineStep): Replaces cScrollbarPixelsPerLineStep.
+        (WebCore::Scrollbar::minFractionToStepWhenPaging): Replaces cFractionToStepWhenPaging.
+        * platform/ScrollbarTheme.h:
+        (WebCore::ScrollbarTheme::maxOverlapBetweenPages): A base implementation
+        that returns the largest int.
+        * platform/gtk/WheelEventGtk.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
+        constants.
+        * platform/haiku/PlatformWheelEventHaiku.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
+        constants.
+        * platform/mac/ScrollbarThemeMac.h:
+        (WebCore::ScrollbarThemeMac::maxOverlapBetweenPages): An override
+        that returns 40.
+        * platform/mac/WheelEventMac.mm:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use
+        Scrollbar::pixelsPerLineStep() instead of cScrollbarPixelsPerLineStep.
+        * platform/wx/MouseWheelEventWx.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use Scrollbar methods instead of
+        constants.
+        * platform/wx/ScrollViewWx.cpp:
+        (WebCore::ScrollView::ScrollViewPrivate::OnScrollWinEvents): Use Scrollbar
+        methods instead of constants, and cap the scroll distance if needed.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout): Ditto.
+
 2010-02-04  No'am Rosenthal  <noam.rosenthal at nokia.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index fbab12e..ba1dd71 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -1,3 +1,4 @@
+
 .objc_class_name_DOMAbstractView
 .objc_class_name_DOMAttr
 .objc_class_name_DOMCDATASection
@@ -760,6 +761,7 @@ __ZN7WebCore9PageGroup26setShouldTrackVisitedLinksEb
 __ZN7WebCore9PageGroup29removeUserStyleSheetFromWorldEPNS_15DOMWrapperWorldERKNS_4KURLE
 __ZN7WebCore9PageGroup30removeUserStyleSheetsFromWorldEPNS_15DOMWrapperWorldE
 __ZN7WebCore9PageGroup9pageGroupERKNS_6StringE
+__ZN7WebCore9Scrollbar22maxOverlapBetweenPagesEv
 __ZN7WebCore9TimerBase4stopEv
 __ZN7WebCore9TimerBase5startEdd
 __ZN7WebCore9TimerBaseC2Ev
@@ -1057,4 +1059,3 @@ _wkSetUpFontCache
 _wkSignalCFReadStreamEnd
 _wkSignalCFReadStreamError
 _wkSignalCFReadStreamHasBytes
-
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 6a9e10f..437d584 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -260,7 +260,7 @@ static int verticalScrollDistance(Frame* frame)
     if (!(style->overflowY() == OSCROLL || style->overflowY() == OAUTO || renderer->isTextArea()))
         return 0;
     int height = toRenderBox(renderer)->clientHeight();
-    return max(height * cFractionToStepWhenPaging, 1.f);
+    return max(max<int>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages()), 1);
 }
 
 static RefPtr<Range> unionDOMRanges(Range* a, Range* b)
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index e4291cc..630ad12 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -425,7 +425,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
     if (m_horizontalScrollbar) {
         int clientWidth = visibleWidth();
         m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth);
-        int pageStep = max(clientWidth * cFractionToStepWhenPaging, 1.f);
+        int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
         IntRect oldRect(m_horizontalScrollbar->frameRect());
         IntRect hBarRect = IntRect(0,
                                    height() - m_horizontalScrollbar->height(),
@@ -437,7 +437,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
 
         if (m_scrollbarsSuppressed)
             m_horizontalScrollbar->setSuppressInvalidation(true);
-        m_horizontalScrollbar->setSteps(cScrollbarPixelsPerLineStep, pageStep);
+        m_horizontalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
         m_horizontalScrollbar->setValue(scroll.width());
         if (m_scrollbarsSuppressed)
@@ -447,7 +447,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
     if (m_verticalScrollbar) {
         int clientHeight = visibleHeight();
         m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
-        int pageStep = max(clientHeight * cFractionToStepWhenPaging, 1.f);
+        int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
         if (pageStep < 0)
             pageStep = clientHeight;
         IntRect oldRect(m_verticalScrollbar->frameRect());
@@ -461,7 +461,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
 
         if (m_scrollbarsSuppressed)
             m_verticalScrollbar->setSuppressInvalidation(true);
-        m_verticalScrollbar->setSteps(cScrollbarPixelsPerLineStep, pageStep);
+        m_verticalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
         m_verticalScrollbar->setValue(scroll.height());
         if (m_scrollbarsSuppressed)
@@ -663,7 +663,7 @@ void ScrollView::wheelEvent(PlatformWheelEvent& e)
         if (e.granularity() == ScrollByPageWheelEvent) {
             ASSERT(deltaX == 0);
             bool negative = deltaY < 0;
-            deltaY = max(visibleHeight() * cFractionToStepWhenPaging, 1.f);
+            deltaY = max(max<int>(visibleHeight() * Scrollbar::minFractionToStepWhenPaging(), visibleHeight() - Scrollbar::maxOverlapBetweenPages()), 1);
             if (negative)
                 deltaY = -deltaY;
         }
diff --git a/WebCore/platform/Scrollbar.cpp b/WebCore/platform/Scrollbar.cpp
index 95f198e..1b4f100 100644
--- a/WebCore/platform/Scrollbar.cpp
+++ b/WebCore/platform/Scrollbar.cpp
@@ -38,8 +38,7 @@
 
 #include <algorithm>
 
-using std::max;
-using std::min;
+using namespace std;
 
 namespace WebCore {
 
@@ -50,6 +49,12 @@ PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollbarClient* client,
 }
 #endif
 
+int Scrollbar::maxOverlapBetweenPages()
+{
+    static int maxOverlapBetweenPages = ScrollbarTheme::nativeTheme()->maxOverlapBetweenPages();
+    return maxOverlapBetweenPages;
+}
+
 Scrollbar::Scrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize controlSize,
                      ScrollbarTheme* theme)
     : m_client(client)
diff --git a/WebCore/platform/Scrollbar.h b/WebCore/platform/Scrollbar.h
index 49907ba..87310c3 100644
--- a/WebCore/platform/Scrollbar.h
+++ b/WebCore/platform/Scrollbar.h
@@ -40,19 +40,17 @@ class ScrollbarClient;
 class ScrollbarTheme;
 class PlatformMouseEvent;
 
-const int cScrollbarPixelsPerLineStep = 40;
-const float cFractionToStepWhenPaging = 0.875f;
-
 class Scrollbar : public Widget {
-protected:
-    Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
-
 public:
     virtual ~Scrollbar();
 
     // Must be implemented by platforms that can't simply use the Scrollbar base class.  Right now the only platform that is not using the base class is GTK.
     static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size);
-    
+
+    static int pixelsPerLineStep() { return 40; }
+    static float minFractionToStepWhenPaging() { return 0.875f; }
+    static int maxOverlapBetweenPages();
+
     void setClient(ScrollbarClient* client) { m_client = client; }
     ScrollbarClient* client() const { return m_client; }
 
@@ -130,6 +128,8 @@ private:
     virtual bool isScrollbar() const { return true; }
 
 protected:
+    Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+
     virtual void updateThumbPosition();
     virtual void updateThumbProportion();
 
diff --git a/WebCore/platform/ScrollbarTheme.h b/WebCore/platform/ScrollbarTheme.h
index 01229e1..c5c2094 100644
--- a/WebCore/platform/ScrollbarTheme.h
+++ b/WebCore/platform/ScrollbarTheme.h
@@ -81,7 +81,9 @@ public:
     virtual int thumbLength(Scrollbar*) { return 0; } // The length of the thumb along the axis of the scrollbar.
     virtual int trackPosition(Scrollbar*) { return 0; } // The position of the track relative to the scrollbar.
     virtual int trackLength(Scrollbar*) { return 0; } // The length of the track along the axis of the scrollbar.
-    
+
+    virtual int maxOverlapBetweenPages() { return std::numeric_limits<int>::max(); }
+
     virtual double initialAutoscrollTimerDelay() { return 0.25; }
     virtual double autoscrollTimerDelay() { return 0.05; }
 
diff --git a/WebCore/platform/gtk/WheelEventGtk.cpp b/WebCore/platform/gtk/WheelEventGtk.cpp
index 404bf29..fc6206f 100644
--- a/WebCore/platform/gtk/WheelEventGtk.cpp
+++ b/WebCore/platform/gtk/WheelEventGtk.cpp
@@ -69,8 +69,8 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
     m_metaKey = event->state & GDK_META_MASK;
 
     // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
-    m_deltaX *= static_cast<float>(cScrollbarPixelsPerLineStep);
-    m_deltaY *= static_cast<float>(cScrollbarPixelsPerLineStep);
+    m_deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+    m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
 }
 
 }
diff --git a/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
index 3945f48..21003b6 100644
--- a/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
+++ b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
@@ -54,8 +54,8 @@ PlatformWheelEvent::PlatformWheelEvent(BMessage* message)
     m_wheelTicksX = m_deltaX;
     m_wheelTicksY = m_deltaY;
 
-    m_deltaX *= -cScrollbarPixelsPerLineStep;
-    m_deltaY *= -cScrollbarPixelsPerLineStep;
+    m_deltaX *= -Scrollbar::pixelsPerLineStep();
+    m_deltaY *= -Scrollbar::pixelsPerLineStep();
 }
 
 } // namespace WebCore
diff --git a/WebCore/platform/mac/ScrollbarThemeMac.h b/WebCore/platform/mac/ScrollbarThemeMac.h
index 5af5fd5..c833ee7 100644
--- a/WebCore/platform/mac/ScrollbarThemeMac.h
+++ b/WebCore/platform/mac/ScrollbarThemeMac.h
@@ -57,6 +57,8 @@ protected:
     virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
     virtual IntRect trackRect(Scrollbar*, bool painting = false);
 
+    virtual int maxOverlapBetweenPages() { return 40; }
+
     virtual int minimumThumbLength(Scrollbar*);
     
     virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
diff --git a/WebCore/platform/mac/WheelEventMac.mm b/WebCore/platform/mac/WheelEventMac.mm
index f380e3e..c9a0efc 100644
--- a/WebCore/platform/mac/WheelEventMac.mm
+++ b/WebCore/platform/mac/WheelEventMac.mm
@@ -45,13 +45,13 @@ PlatformWheelEvent::PlatformWheelEvent(NSEvent* event, NSView *windowView)
     BOOL continuous;
     wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &continuous);
     if (continuous) {
-        m_wheelTicksX = m_deltaX / static_cast<float>(cScrollbarPixelsPerLineStep);
-        m_wheelTicksY = m_deltaY / static_cast<float>(cScrollbarPixelsPerLineStep);
+        m_wheelTicksX = m_deltaX / static_cast<float>(Scrollbar::pixelsPerLineStep());
+        m_wheelTicksY = m_deltaY / static_cast<float>(Scrollbar::pixelsPerLineStep());
     } else {
         m_wheelTicksX = m_deltaX;
         m_wheelTicksY = m_deltaY;
-        m_deltaX *= static_cast<float>(cScrollbarPixelsPerLineStep);
-        m_deltaY *= static_cast<float>(cScrollbarPixelsPerLineStep);
+        m_deltaX *= static_cast<float>(Scrollbar::pixelsPerLineStep());
+        m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
     }
 }
 
diff --git a/WebCore/platform/wx/MouseWheelEventWx.cpp b/WebCore/platform/wx/MouseWheelEventWx.cpp
index 9f3923d..aa41df4 100644
--- a/WebCore/platform/wx/MouseWheelEventWx.cpp
+++ b/WebCore/platform/wx/MouseWheelEventWx.cpp
@@ -47,7 +47,7 @@ PlatformWheelEvent::PlatformWheelEvent(const wxMouseEvent& event, const wxPoint&
     , m_isAccepted(false)
 {
     // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
-    m_deltaY *= static_cast<float>(cScrollbarPixelsPerLineStep);
+    m_deltaY *= static_cast<float>(Scrollbar::pixelsPerLineStep());
 }
 
 }
diff --git a/WebCore/platform/wx/ScrollViewWx.cpp b/WebCore/platform/wx/ScrollViewWx.cpp
index 35acf68..35d62b2 100644
--- a/WebCore/platform/wx/ScrollViewWx.cpp
+++ b/WebCore/platform/wx/ScrollViewWx.cpp
@@ -84,27 +84,27 @@ public:
         }
         else if (scrollType == wxEVT_SCROLLWIN_LINEDOWN) {
             if (horiz) 
-                pos.x += cScrollbarPixelsPerLineStep;
+                pos.x += Scrollbar::pixelsPerLineStep();
             else       
-                pos.y += cScrollbarPixelsPerLineStep;
+                pos.y += Scrollbar::pixelsPerLineStep();
         }
         else if (scrollType == wxEVT_SCROLLWIN_LINEUP) {
             if (horiz) 
-                pos.x -= cScrollbarPixelsPerLineStep;
+                pos.x -= Scrollbar::pixelsPerLineStep();
             else       
-                pos.y -= cScrollbarPixelsPerLineStep;
+                pos.y -= Scrollbar::pixelsPerLineStep();
         }
         else if (scrollType == wxEVT_SCROLLWIN_PAGEUP) {
             if (horiz) 
-                pos.x -= m_scrollView->visibleWidth() * cFractionToStepWhenPaging;
+                pos.x -= max<int>(m_scrollView->visibleWidth() * Scrollbar::minFractionToStepWhenPaging(), m_scrollView->visibleWidth() - Scrollbar::maxOverlapBetweenPages());
             else       
-                pos.y -= m_scrollView->visibleHeight() * cFractionToStepWhenPaging;
+                pos.y -= max<int>(m_scrollView->visibleHeight() * Scrollbar::minFractionToStepWhenPaging(), m_scrollView->visibleHeight() - Scrollbar::maxOverlapBetweenPages());
         }
         else if (scrollType == wxEVT_SCROLLWIN_PAGEDOWN) {
             if (horiz) 
-                pos.x += m_scrollView->visibleWidth() * cFractionToStepWhenPaging;
+                pos.x += max<int>(m_scrollView->visibleWidth() * Scrollbar::minFractionToStepWhenPaging(), m_scrollView->visibleWidth() - Scrollbar::maxOverlapBetweenPages());
             else       
-                pos.y += m_scrollView->visibleHeight() * cFractionToStepWhenPaging;
+                pos.y += max<int>(m_scrollView->visibleHeight() * Scrollbar::minFractionToStepWhenPaging(), m_scrollView->visibleHeight() - Scrollbar::maxOverlapBetweenPages());
         }
         else
             return e.Skip();
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 97e071e..5d4d3bd 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -1934,8 +1934,8 @@ RenderLayer::updateScrollInfoAfterLayout()
     // Set up the range (and page step/line step).
     if (m_hBar) {
         int clientWidth = box->clientWidth();
-        int pageStep = max(clientWidth * cFractionToStepWhenPaging, 1.f);
-        m_hBar->setSteps(cScrollbarPixelsPerLineStep, pageStep);
+        int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
+        m_hBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_hBar->setProportion(clientWidth, m_scrollWidth);
         // Explicitly set the horizontal scroll value.  This ensures that when a
         // right-to-left scrollable area's width (or content width) changes, the
@@ -1949,8 +1949,8 @@ RenderLayer::updateScrollInfoAfterLayout()
     }
     if (m_vBar) {
         int clientHeight = box->clientHeight();
-        int pageStep = max(clientHeight * cFractionToStepWhenPaging, 1.f);
-        m_vBar->setSteps(cScrollbarPixelsPerLineStep, pageStep);
+        int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
+        m_vBar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
         m_vBar->setProportion(clientHeight, m_scrollHeight);
     }
  
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 8bbd4de..e161141 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-04  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        REGRESSION (r53718): When scrolling a tall window by page, the overlap between pages is too big
+        https://bugs.webkit.org/show_bug.cgi?id=34371
+
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _verticalPageScrollDistance]): Use Scrollbar methods instead of
+        constants, and cap the scroll distance.
+        (-[WebFrameView initWithFrame:]): Use Scrollbar::pixelsPerLineStep() instead of
+        cScrollbarPixelsPerLineStep.
+        (-[WebFrameView _horizontalPageScrollDistance]):Use Scrollbar methods instead of
+        constants, and cap the scroll distance.
+
 2010-02-01  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKit/mac/WebView/WebFrameView.mm b/WebKit/mac/WebView/WebFrameView.mm
index 565e64d..b6b1941 100644
--- a/WebKit/mac/WebView/WebFrameView.mm
+++ b/WebKit/mac/WebView/WebFrameView.mm
@@ -201,7 +201,7 @@ enum {
 - (float)_verticalPageScrollDistance
 {
     float height = [[self _contentView] bounds].size.height;
-    return max(height * cFractionToStepWhenPaging, 1.f);
+    return max<float>(height * Scrollbar::minFractionToStepWhenPaging(), height - Scrollbar::maxOverlapBetweenPages());
 }
 
 static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCClass, NSArray *supportTypes)
@@ -342,7 +342,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     [scrollView setHasVerticalScroller:NO];
     [scrollView setHasHorizontalScroller:NO];
     [scrollView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
-    [scrollView setLineScroll:cScrollbarPixelsPerLineStep];
+    [scrollView setLineScroll:Scrollbar::pixelsPerLineStep()];
     [self addSubview:scrollView];
 
     // Don't call our overridden version of setNextKeyView here; we need to make the standard NSView
@@ -613,7 +613,7 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 - (float)_horizontalPageScrollDistance
 {
     float width = [[self _contentView] bounds].size.width;
-    return max(width * cFractionToStepWhenPaging, 1.f);
+    return max<float>(width * Scrollbar::minFractionToStepWhenPaging(), width - Scrollbar::maxOverlapBetweenPages());
 }
 
 - (BOOL)_pageVertically:(BOOL)up
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index 26d14d6..a04d45f 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,13 @@
+2010-02-04  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        REGRESSION (r53718): When scrolling a tall window by page, the overlap between pages is too big
+        https://bugs.webkit.org/show_bug.cgi?id=34371
+
+        * WebView.cpp:
+        (wxWebView::OnKeyEvents): Use Scrollbar method instead of constant.
+
 2010-02-03  Kevin Watters  <kevinwatters at gmail.com>
 
         Reviewed by Kevin Ollivier.
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index 5fdae83..a98ec30 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -797,19 +797,19 @@ void wxWebView::OnKeyEvents(wxKeyEvent& event)
             break;
         case WXK_LEFT:
         case WXK_NUMPAD_LEFT:
-            frame->view()->scrollBy(WebCore::IntSize(-WebCore::cScrollbarPixelsPerLineStep, 0));
+            frame->view()->scrollBy(WebCore::IntSize(-WebCore::Scrollbar::pixelsPerLineStep(), 0));
             return;
         case WXK_UP:
         case WXK_NUMPAD_UP:
-            frame->view()->scrollBy(WebCore::IntSize(0, -WebCore::cScrollbarPixelsPerLineStep));
+            frame->view()->scrollBy(WebCore::IntSize(0, -WebCore::Scrollbar::pixelsPerLineStep()));
             return;
         case WXK_RIGHT:
         case WXK_NUMPAD_RIGHT:
-            frame->view()->scrollBy(WebCore::IntSize(WebCore::cScrollbarPixelsPerLineStep, 0));
+            frame->view()->scrollBy(WebCore::IntSize(WebCore::Scrollbar::pixelsPerLineStep(), 0));
             return;
         case WXK_DOWN:
         case WXK_NUMPAD_DOWN:
-            frame->view()->scrollBy(WebCore::IntSize(0, WebCore::cScrollbarPixelsPerLineStep));
+            frame->view()->scrollBy(WebCore::IntSize(0, WebCore::Scrollbar::pixelsPerLineStep()));
             return;
         case WXK_END:
         case WXK_NUMPAD_END:
@@ -821,11 +821,11 @@ void wxWebView::OnKeyEvents(wxKeyEvent& event)
             return;
         case WXK_PAGEUP:
         case WXK_NUMPAD_PAGEUP:
-            frame->view()->scrollBy(WebCore::IntSize(0, -frame->view()->visibleHeight() * WebCore::cFractionToStepWhenPaging));
+            frame->view()->scrollBy(WebCore::IntSize(0, -frame->view()->visibleHeight() * WebCore::ScrollBar::minFractionToStepWhenPaging()));
             return;
         case WXK_PAGEDOWN:
         case WXK_NUMPAD_PAGEDOWN:
-            frame->view()->scrollBy(WebCore::IntSize(0, frame->view()->visibleHeight() * WebCore::cFractionToStepWhenPaging));
+            frame->view()->scrollBy(WebCore::IntSize(0, frame->view()->visibleHeight() * WebCore::ScrollBar::minFractionToStepWhenPaging()));
             return;
         //These we don't want turning into char events, stuff 'em
         case WXK_ESCAPE:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list