Title: [195188] releases/WebKitGTK/webkit-2.10/Source/WebCore
Revision
195188
Author
[email protected]
Date
2016-01-18 00:10:59 -0800 (Mon, 18 Jan 2016)

Log Message

Merge r194155 - Legacy style scrollbars do not change color when you mouse over them if you
are scrolled
https://bugs.webkit.org/show_bug.cgi?id=152319
-and corresponding-
rdar://problem/23317668

Reviewed by Darin Adler.

The scrollbar’s frameRect is in window coordinates, so we need to compare a
point in window coordinates when we test this.

The call to convertFromContainingWindow does not return a point in view
coordinates, so we should not call the variable viewPoint. We do still need
to call it for subframes. convertFromContainingWindow doesn’t do anything for
the root ScrollView (for Mac WK2 at least).
* platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarAtPoint):

HitTestLocation is in contents coordinates. It needs to be converted to
window coordinates
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195187 => 195188)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 08:09:10 UTC (rev 195187)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog	2016-01-18 08:10:59 UTC (rev 195188)
@@ -1,3 +1,28 @@
+2015-12-16  Beth Dakin  <[email protected]>
+
+        Legacy style scrollbars do not change color when you mouse over them if you 
+        are scrolled
+        https://bugs.webkit.org/show_bug.cgi?id=152319
+        -and corresponding-
+        rdar://problem/23317668
+
+        Reviewed by Darin Adler.
+
+        The scrollbar’s frameRect is in window coordinates, so we need to compare a 
+        point in window coordinates when we test this.
+
+        The call to convertFromContainingWindow does not return a point in view 
+        coordinates, so we should not call the variable viewPoint. We do still need 
+        to call it for subframes. convertFromContainingWindow doesn’t do anything for 
+        the root ScrollView (for Mac WK2 at least).
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::scrollbarAtPoint):
+
+        HitTestLocation is in contents coordinates. It needs to be converted to 
+        window coordinates
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::hitTest):
+
 2016-01-04  Sergio Villar Senin  <[email protected]>
 
         REGRESSION(r194143): Float width incorrectly calculated on Wikipedia

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp (195187 => 195188)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp	2016-01-18 08:09:10 UTC (rev 195187)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/platform/ScrollView.cpp	2016-01-18 08:10:59 UTC (rev 195188)
@@ -996,10 +996,12 @@
     if (platformWidget())
         return 0;
 
-    IntPoint viewPoint = convertFromContainingWindow(windowPoint);
-    if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
+    // convertFromContainingWindow doesn't do what it sounds like it does. We need it here just to get this
+    // point into the right coordinates if this is the ScrollView of a sub-frame.
+    IntPoint convertedPoint = convertFromContainingWindow(windowPoint);
+    if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(convertedPoint))
         return m_horizontalScrollbar.get();
-    if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(viewPoint))
+    if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(convertedPoint))
         return m_verticalScrollbar.get();
     return 0;
 }

Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderView.cpp (195187 => 195188)


--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderView.cpp	2016-01-18 08:09:10 UTC (rev 195187)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderView.cpp	2016-01-18 08:10:59 UTC (rev 195188)
@@ -205,8 +205,8 @@
     if (request.allowsFrameScrollbars()) {
         // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,
         // so we need to test ScrollView scrollbars separately here.
-        Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(location.roundedPoint());
-        if (frameScrollbar) {
+        IntPoint windowPoint = frameView().contentsToWindow(location.roundedPoint());
+        if (Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(windowPoint)) {
             result.setScrollbar(frameScrollbar);
             return true;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to