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 17:47:55 +0000 (17:47 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 May 2010 17:47:55 +0000 (17:47 +0000)
        Reviewed by Xan Lopez.

        [GTK] Adjustment resetting uses wrong values, and misses page_size and steps
        https://bugs.webkit.org/show_bug.cgi?id=38657

        Fix resetting adjustment values. In the page cache case, we were
        confusing page_size and upper, leading to stray scrollbars
        sometimes.

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

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

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

index 8f36a1a..ff2f730 100644 (file)
@@ -1,3 +1,17 @@
+2010-05-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Adjustment resetting uses wrong values, and misses page_size and steps
+        https://bugs.webkit.org/show_bug.cgi?id=38657
+
+        Fix resetting adjustment values. In the page cache case, we were
+        confusing page_size and upper, leading to stray scrollbars
+        sometimes.
+
+        * platform/gtk/ScrollViewGtk.cpp:
+        (WebCore::ScrollView::setGtkAdjustments):
+
 2010-05-06  Darin Adler  <darin@apple.com>
 
         Reviewed by Beth Dakin.
index 3df3cb5..de770d5 100644 (file)
@@ -100,17 +100,21 @@ 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.
-        m_horizontalAdjustment->lower = 0;
-        m_horizontalAdjustment->upper = resetValues ? 0 : frameRect().width();
-        m_horizontalAdjustment->value = resetValues ? 0 : scrollOffset().width();
-        gtk_adjustment_changed(m_horizontalAdjustment);
-        gtk_adjustment_value_changed(m_horizontalAdjustment);
-
-        m_verticalAdjustment->lower = 0;
-        m_verticalAdjustment->upper = resetValues ? 0 : frameRect().height();
-        m_verticalAdjustment->value = resetValues ? 0 : scrollOffset().height();
-        gtk_adjustment_changed(m_verticalAdjustment);
-        gtk_adjustment_value_changed(m_verticalAdjustment);
+        bool resetHorizontal = resetValues || !hScrollbar;
+        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());
+
+        bool resetVertical = resetValues || !vScrollbar;
+        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());
     } else {
         ScrollbarGtk* hScrollbar = reinterpret_cast<ScrollbarGtk*>(horizontalScrollbar());
         if (hScrollbar)