2011-01-17 Martin Robinson <mrobinson@igalia.com>
authormrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Feb 2011 21:01:43 +0000 (21:01 +0000)
committermrobinson@webkit.org <mrobinson@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Feb 2011 21:01:43 +0000 (21:01 +0000)
        Reviewed by Xan Lopez.

        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
        https://bugs.webkit.org/show_bug.cgi?id=49177

        * platform/gtk/Skipped: Unskip passing test.
2011-01-17  Martin Robinson  <mrobinson@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
        https://bugs.webkit.org/show_bug.cgi?id=49177

        * platform/ScrollView.cpp: Remove the GTK+ guards around the implementation
        of platformAddChild and platformRemoveChild. This code can be shared.
        * platform/gtk/MainFrameScrollbarGtk.cpp:
        (MainFrameScrollbarGtk::attachAdjustment): Prevent re-attaching an already attached
        adjustment. Connect the adjustment value-changed signal handler after resetting the
        adjustment. This prevents the rest from stomping on pre-existing WebCore values.
        (MainFrameScrollbarGtk::gtkValueChanged): If the scrollbar is no longer attached to
        a scrollview do not listing for value changes. These scrollbars are defunct.
        * platform/gtk/ScrollViewGtk.cpp: Remove duplicated empty methods.

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

LayoutTests/ChangeLog
LayoutTests/platform/gtk/Skipped
Source/WebCore/ChangeLog
Source/WebCore/platform/ScrollView.cpp
Source/WebCore/platform/gtk/MainFrameScrollbarGtk.cpp
Source/WebCore/platform/gtk/ScrollViewGtk.cpp

index 8b9a0b4..eefc654 100644 (file)
@@ -1,3 +1,12 @@
+2011-01-17  Martin Robinson  <mrobinson@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
+        https://bugs.webkit.org/show_bug.cgi?id=49177
+
+        * platform/gtk/Skipped: Unskip passing test.
+
 2011-02-22  Jer Noble  <jer.noble@apple.com>
 
         Unreviewed, adding new pixel tests to the skipped list of various platforms.
index bb27c1e..7197656 100644 (file)
@@ -1253,9 +1253,6 @@ fast/frames/meta-refresh-user-gesture.html
 # https://bugs.webkit.org/show_bug.cgi?id=49052
 fast/canvas/pointInPath.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=49177
-fast/events/scroll-after-click-on-tab-index.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=49179
 animations/stop-animation-on-suspend.html
 
@@ -1327,4 +1324,4 @@ http/tests/misc/generated-content-inside-table.html
 # [GTK] Generate results for media/audio-repaint.html and media/media-document-audio-repaint.html
 # https://bugs.webkit.org/show_bug.cgi?id=54985
 media/audio-repaint.html
-media/media-document-audio-repaint.html
\ No newline at end of file
+media/media-document-audio-repaint.html
index 083656f..12f05a1 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-17  Martin Robinson  <mrobinson@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] fast/events/scroll-after-click-on-tab-index has been failing on the bots
+        https://bugs.webkit.org/show_bug.cgi?id=49177
+
+        * platform/ScrollView.cpp: Remove the GTK+ guards around the implementation
+        of platformAddChild and platformRemoveChild. This code can be shared.
+        * platform/gtk/MainFrameScrollbarGtk.cpp:
+        (MainFrameScrollbarGtk::attachAdjustment): Prevent re-attaching an already attached
+        adjustment. Connect the adjustment value-changed signal handler after resetting the
+        adjustment. This prevents the rest from stomping on pre-existing WebCore values.
+        (MainFrameScrollbarGtk::gtkValueChanged): If the scrollbar is no longer attached to
+        a scrollview do not listing for value changes. These scrollbars are defunct.
+        * platform/gtk/ScrollViewGtk.cpp: Remove duplicated empty methods.
+
 2011-02-22  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 4833aba..8e1577f 100644 (file)
@@ -1174,7 +1174,7 @@ void ScrollView::platformDestroy()
 
 #endif
 
-#if !PLATFORM(WX) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(MAC)
+#if !PLATFORM(WX) && !PLATFORM(QT) && !PLATFORM(MAC)
 
 void ScrollView::platformAddChild(Widget*)
 {
index d1571a5..d8cdb79 100644 (file)
@@ -60,6 +60,8 @@ MainFrameScrollbarGtk::~MainFrameScrollbarGtk()
 
 void MainFrameScrollbarGtk::attachAdjustment(GtkAdjustment* adjustment)
 {
+    if (m_adjustment.get() == adjustment)
+        return;
     if (m_adjustment)
         detachAdjustment();
 
@@ -67,9 +69,9 @@ void MainFrameScrollbarGtk::attachAdjustment(GtkAdjustment* adjustment)
     if (!m_adjustment)
         return;
 
-    g_signal_connect(m_adjustment.get(), "value-changed", G_CALLBACK(MainFrameScrollbarGtk::gtkValueChanged), this);
     updateThumbProportion();
     updateThumbPosition();
+    g_signal_connect(m_adjustment.get(), "value-changed", G_CALLBACK(MainFrameScrollbarGtk::gtkValueChanged), this);
 }
 
 void MainFrameScrollbarGtk::detachAdjustment()
@@ -109,7 +111,17 @@ void MainFrameScrollbarGtk::updateThumbProportion()
 
 void MainFrameScrollbarGtk::gtkValueChanged(GtkAdjustment*, MainFrameScrollbarGtk* that)
 {
-    that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get())));
+    // If we've been removed from our parent, we no longer get to control the WebCore
+    // scrollbar. If this is the case, deactivate this signal handler. WebCore will
+    // create a fresh MainFrameScrollbar when the scrollbar reappears.
+    if (!that->parent()) {
+        that->detachAdjustment();
+        return;
+    }
+
+    int newValue = static_cast<int>(gtk_adjustment_get_value(that->m_adjustment.get()));
+    if (newValue != that->value())
+        that->scrollableArea()->scrollToOffsetWithoutAnimation(that->orientation(), newValue);
 }
 
 void MainFrameScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
index a8c7562..d3a5278 100644 (file)
@@ -162,14 +162,6 @@ void ScrollView::setGtkAdjustments(GtkAdjustment* hadj, GtkAdjustment* vadj, boo
     setVerticalAdjustment(vadj, resetValues);
 }
 
-void ScrollView::platformAddChild(Widget* child)
-{
-}
-
-void ScrollView::platformRemoveChild(Widget* child)
-{
-}
-
 IntRect ScrollView::visibleContentRect(bool includeScrollbars) const
 {
     // If we are an interior frame scrollbar or are in some sort of transition