2010-05-06 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 May 2010 18:46:22 +0000 (18:46 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 May 2010 18:46:22 +0000 (18:46 +0000)
        Reviewed by Xan Lopez.

        Rework where we get page step and line step from, so we do not
        depend on scrollbars existing. Caught by API test I forgot to run.

        * platform/gtk/ScrollViewGtk.cpp:
        (WebCore::ScrollView::setGtkAdjustments):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/gtk/ScrollViewGtk.cpp

index ff2f7303799a9bcba45c451e31124f28247803b9..b5d29bd30f99d08fe24425764ee6a9991639f272 100644 (file)
@@ -1,3 +1,13 @@
+2010-05-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        Rework where we get page step and line step from, so we do not
+        depend on scrollbars existing. Caught by API test I forgot to run.
+
+        * platform/gtk/ScrollViewGtk.cpp:
+        (WebCore::ScrollView::setGtkAdjustments):
+
 2010-05-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         Reviewed by Xan Lopez.
 2010-05-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         Reviewed by Xan Lopez.
index de770d530d65b81cb53b0e64ab05271d591458d5..fe43192f1e787a1074974c9969b14fb71c68ae44 100644 (file)
@@ -100,21 +100,22 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
         // set in the normal case), we make sure they are up-to-date
         // here. This is needed for the parent scrolling widget to be
         // able to report correct values.
         // set in the normal case), we make sure they are up-to-date
         // here. This is needed for the parent scrolling widget to be
         // able to report correct values.
-        bool resetHorizontal = resetValues || !hScrollbar;
+
+        int horizontalPageStep = max(max<int>(frameRect().width() * Scrollbar::minFractionToStepWhenPaging(), frameRect().width() - Scrollbar::maxOverlapBetweenPages()), 1);
         gtk_adjustment_configure(m_horizontalAdjustment,
         gtk_adjustment_configure(m_horizontalAdjustment,
-                                 resetHorizontal ? 0 : scrollOffset().width(), 0,
-                                 resetHorizontal ? 0 : contentsSize().width(),
-                                 resetHorizontal ? 0 : hScrollbar->lineStep(),
-                                 resetHorizontal ? 0 : hScrollbar->pageStep(),
-                                 resetHorizontal ? 0 : frameRect().width());
+                                 resetValues ? 0 : scrollOffset().width(), 0,
+                                 resetValues ? 0 : contentsSize().width(),
+                                 resetValues ? 0 : Scrollbar::pixelsPerLineStep(),
+                                 resetValues ? 0 : horizontalPageStep,
+                                 resetValues ? 0 : frameRect().width());
 
 
-        bool resetVertical = resetValues || !vScrollbar;
+        int verticalPageStep = max(max<int>(frameRect().height() * Scrollbar::minFractionToStepWhenPaging(), frameRect().height() - Scrollbar::maxOverlapBetweenPages()), 1);
         gtk_adjustment_configure(m_verticalAdjustment,
         gtk_adjustment_configure(m_verticalAdjustment,
-                                 resetVertical ? 0 : scrollOffset().width(), 0,
-                                 resetVertical ? 0 : contentsSize().width(),
-                                 resetVertical ? 0 : vScrollbar->lineStep(),
-                                 resetVertical ? 0 : vScrollbar->pageStep(),
-                                 resetVertical ? 0 : frameRect().width());
+                                 resetValues ? 0 : scrollOffset().height(), 0,
+                                 resetValues ? 0 : contentsSize().height(),
+                                 resetValues ? 0 : Scrollbar::pixelsPerLineStep(),
+                                 resetValues ? 0 : verticalPageStep,
+                                 resetValues ? 0 : frameRect().height());
     } else {
         ScrollbarGtk* hScrollbar = reinterpret_cast<ScrollbarGtk*>(horizontalScrollbar());
         if (hScrollbar)
     } else {
         ScrollbarGtk* hScrollbar = reinterpret_cast<ScrollbarGtk*>(horizontalScrollbar());
         if (hScrollbar)