Changeset 194155 in webkit


Ignore:
Timestamp:
Dec 16, 2015 10:08:57 AM (8 years ago)
Author:
Beth Dakin
Message:

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

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194143 r194155  
     12015-12-16  Beth Dakin  <bdakin@apple.com>
     2
     3        Legacy style scrollbars do not change color when you mouse over them if you
     4        are scrolled
     5        https://bugs.webkit.org/show_bug.cgi?id=152319
     6        -and corresponding-
     7        rdar://problem/23317668
     8
     9        Reviewed by Darin Adler.
     10
     11        The scrollbar’s frameRect is in window coordinates, so we need to compare a
     12        point in window coordinates when we test this.
     13
     14        The call to convertFromContainingWindow does not return a point in view
     15        coordinates, so we should not call the variable viewPoint. We do still need
     16        to call it for subframes. convertFromContainingWindow doesn’t do anything for
     17        the root ScrollView (for Mac WK2 at least).
     18        * platform/ScrollView.cpp:
     19        (WebCore::ScrollView::scrollbarAtPoint):
     20
     21        HitTestLocation is in contents coordinates. It needs to be converted to
     22        window coordinates
     23        * rendering/RenderView.cpp:
     24        (WebCore::RenderView::hitTest):
     25
    1262015-12-08  Sergio Villar Senin  <svillar@igalia.com>
    227
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r192140 r194155  
    997997        return 0;
    998998
    999     IntPoint viewPoint = convertFromContainingWindow(windowPoint);
    1000     if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
     999    // convertFromContainingWindow doesn't do what it sounds like it does. We need it here just to get this
     1000    // point into the right coordinates if this is the ScrollView of a sub-frame.
     1001    IntPoint convertedPoint = convertFromContainingWindow(windowPoint);
     1002    if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(convertedPoint))
    10011003        return m_horizontalScrollbar.get();
    1002     if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(viewPoint))
     1004    if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(convertedPoint))
    10031005        return m_verticalScrollbar.get();
    10041006    return 0;
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r192966 r194155  
    205205        // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,
    206206        // so we need to test ScrollView scrollbars separately here.
    207         Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(location.roundedPoint());
    208         if (frameScrollbar) {
     207        IntPoint windowPoint = frameView().contentsToWindow(location.roundedPoint());
     208        if (Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(windowPoint)) {
    209209            result.setScrollbar(frameScrollbar);
    210210            return true;
Note: See TracChangeset for help on using the changeset viewer.