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):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@194155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index ddede65..1906ba3 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -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;
 }