2009-03-07 Xan Lopez <xan@gnome.org>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Mar 2009 12:03:13 +0000 (12:03 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Mar 2009 12:03:13 +0000 (12:03 +0000)
        Reviewed by Holger Freyther.

        https://bugs.webkit.org/show_bug.cgi?id=24358
        [GTK] Scrollbars not clipped correctly

        ScrollView scrollbars in subframes are *not* native, so take that
        into account again.

        * platform/gtk/ScrollbarGtk.cpp:
        (ScrollbarGtk::getLocationInParentWindow):
        (ScrollbarGtk::frameRectsChanged):
        (ScrollbarGtk::paint):
        * platform/gtk/ScrollbarGtk.h:

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

WebCore/ChangeLog
WebCore/platform/gtk/ScrollbarGtk.cpp
WebCore/platform/gtk/ScrollbarGtk.h

index 0c4109a5e490025c7feed5b1fabb26dd183ca773..1489cb209ae15b968a1c6c5f8ff825fa4837edf6 100644 (file)
@@ -1,3 +1,19 @@
+2009-03-07  Xan Lopez  <xan@gnome.org>
+
+        Reviewed by Holger Freyther.
+
+        https://bugs.webkit.org/show_bug.cgi?id=24358
+        [GTK] Scrollbars not clipped correctly
+
+        ScrollView scrollbars in subframes are *not* native, so take that
+        into account again.
+
+        * platform/gtk/ScrollbarGtk.cpp:
+        (ScrollbarGtk::getLocationInParentWindow):
+        (ScrollbarGtk::frameRectsChanged):
+        (ScrollbarGtk::paint):
+        * platform/gtk/ScrollbarGtk.h:
+
 2009-03-06  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Darin Fisher.
index be4c1c401e619f7753a9ac5baa06eea9e892f198..7543e23ff37bf07315aed1d2ddd1995bf2b0a7eb 100644 (file)
@@ -65,14 +65,24 @@ ScrollbarGtk::ScrollbarGtk(ScrollbarClient* client, ScrollbarOrientation orienta
            ScrollbarTheme::nativeTheme()->scrollbarThickness());
 }
 
+IntPoint ScrollbarGtk::getLocationInParentWindow(const IntRect& rect)
+{
+    IntPoint loc;
+
+    if (parent()->isScrollViewScrollbar(this))
+        loc = parent()->convertToContainingWindow(rect.location());
+    else
+        loc = parent()->contentsToWindow(rect.location());
+
+    return loc;
+}
+
 void ScrollbarGtk::frameRectsChanged()
 {
     if (!parent())
         return;
 
-    // Translate our coordinates, we are a RenderLayout scrollbar because our
-    // ScrollView scrollbars are native.
-    IntPoint loc = parent()->contentsToWindow(frameRect().location());
+    IntPoint loc = getLocationInParentWindow(frameRect());
 
     // Don't allow the allocation size to be negative
     IntSize sz = frameRect().size();
@@ -141,7 +151,8 @@ void ScrollbarGtk::paint(GraphicsContext* context, const IntRect& rect)
     event->expose = *context->gdkExposeEvent();
     event->expose.area = static_cast<GdkRectangle>(rect);
 
-    IntPoint loc = parent()->contentsToWindow(rect.location());
+    IntPoint loc = getLocationInParentWindow(rect);
+
     event->expose.area.x = loc.x();
     event->expose.area.y = loc.y();
 
index aa26688562383145b62a41e18bc962533754f668..1ef4c493ee3b240ef11a320f58388d56d831dc60 100644 (file)
@@ -57,6 +57,7 @@ protected:
     
 private:
     static void gtkValueChanged(GtkAdjustment*, ScrollbarGtk*);
+    IntPoint getLocationInParentWindow(const IntRect&);
     GtkAdjustment* m_adjustment;
 };