Changeset 195591 in webkit


Ignore:
Timestamp:
Jan 26, 2016 9:00:18 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

Main frame scrollbars not updated on hovering when using overlay scrollbars
https://bugs.webkit.org/show_bug.cgi?id=153304

Reviewed by Michael Catanzaro.

Legacy scrollbars were fixed in r194155, but overlay scrollbars
are not notified when they are hovered. This is because the layer
hit test in RenderView::hitTest always returns true when using
overlay scrollbars and we are returning early in such case,
ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
case of using overlay scrollbars we still need to check the
RenderView scrollbars even when the layer hit test succeeded.

  • rendering/RenderView.cpp:

(WebCore::RenderView::hitTest):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195590 r195591  
     12016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Main frame scrollbars not updated on hovering when using overlay scrollbars
     4        https://bugs.webkit.org/show_bug.cgi?id=153304
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Legacy scrollbars were fixed in r194155, but overlay scrollbars
     9        are not notified when they are hovered. This is because the layer
     10        hit test in RenderView::hitTest always returns true when using
     11        overlay scrollbars and we are returning early in such case,
     12        ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
     13        case of using overlay scrollbars we still need to check the
     14        RenderView scrollbars even when the layer hit test succeeded.
     15
     16        * rendering/RenderView.cpp:
     17        (WebCore::RenderView::hitTest):
     18
    1192016-01-26  Daniel Bates  <dabates@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r194496 r195591  
    4848#include "RenderSelectionInfo.h"
    4949#include "RenderWidget.h"
     50#include "ScrollbarTheme.h"
    5051#include "Settings.h"
    5152#include "StyleInheritedData.h"
     
    198199    FrameFlatteningLayoutDisallower disallower(frameView());
    199200
    200     if (layer()->hitTest(request, location, result))
    201         return true;
    202 
    203     // FIXME: Consider if this test should be done unconditionally.
    204     if (request.allowsFrameScrollbars()) {
    205         // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,
    206         // so we need to test ScrollView scrollbars separately here.
    207         IntPoint windowPoint = frameView().contentsToWindow(location.roundedPoint());
    208         if (Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(windowPoint)) {
    209             result.setScrollbar(frameScrollbar);
    210             return true;
     201    bool resultLayer = layer()->hitTest(request, location, result);
     202
     203    // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,
     204    // so we need to test ScrollView scrollbars separately here. In case of using overlay scrollbars, the layer hit test
     205    // will always work so we need to check the ScrollView scrollbars in that case too.
     206    if (!resultLayer || ScrollbarTheme::theme().usesOverlayScrollbars()) {
     207        // FIXME: Consider if this test should be done unconditionally.
     208        if (request.allowsFrameScrollbars()) {
     209            IntPoint windowPoint = frameView().contentsToWindow(location.roundedPoint());
     210            if (Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(windowPoint)) {
     211                result.setScrollbar(frameScrollbar);
     212                return true;
     213            }
    211214        }
    212215    }
    213216
    214     return false;
     217    return resultLayer;
    215218}
    216219
Note: See TracChangeset for help on using the changeset viewer.