Changeset 122399 in webkit


Ignore:
Timestamp:
Jul 11, 2012 6:29:03 PM (12 years ago)
Author:
rjkroege@chromium.org
Message:

Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
https://bugs.webkit.org/show_bug.cgi?id=89580

Source/WebCore:

WebKit GTK and Chromium Linux force vertical wheel events to
scroll horizontally when over horizontal scroll bars. This is
undesirable for touchpad scrolling with
hasPreciseScrollingDeltas() == true. Modified shouldTurnVerticalTicksIntoHorizontal
to not perform this conversion for PlatformWheelEvents with preciseScrollingDeltas.

Reviewed by Adam Barth.

Tests: fast/events/touch/gesture/touch-gesture-scroll-sideways.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
(WebCore::EventHandler::handleWheelEvent):

  • page/EventHandler.h:

(EventHandler):

  • page/chromium/EventHandlerChromium.cpp:

(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):

  • page/gtk/EventHandlerGtk.cpp:

(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):

Tools:

WebKit GTK and Chromium Linux force vertical wheel events to
scroll horizontally when over horizontal scroll bars. This is
undesirable for touchpad scrolling with
hasPreciseScrollingDeltas() == true. Modified DumpRenderTree to
let a layout test specify this attribute so that the change's impact
on scrolling can be tested in a layout test.

Reviewed by Adam Barth.

  • DumpRenderTree/chromium/EventSender.cpp:

(EventSender::handleMouseWheel):

LayoutTests:

WebKit GTK and Chromium Linux force vertical wheel events to
scroll horizontally when over horizontal scroll bars. This is
undesirable for touchpad scrolling with
hasPreciseScrollingDeltas() == true. Added a layout test showing
that change correctly suppresses this behaviour.

Reviewed by Adam Barth.

  • fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added.
  • fast/events/touch/gesture/touch-gesture-scroll-sideways.html: Added.
  • platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added. Note: test has intentional platform difference.
Location:
trunk
Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r122392 r122399  
     12012-07-11  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
     4        https://bugs.webkit.org/show_bug.cgi?id=89580
     5
     6        WebKit GTK and Chromium Linux force vertical wheel events to
     7        scroll horizontally when over horizontal scroll bars.  This is
     8        undesirable for touchpad scrolling with
     9        hasPreciseScrollingDeltas() == true. Added a layout test showing
     10        that change correctly suppresses this behaviour.
     11
     12        Reviewed by Adam Barth.
     13
     14        * fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added.
     15        * fast/events/touch/gesture/touch-gesture-scroll-sideways.html: Added.
     16        * platform/chromium-linux/fast/events/touch/gesture/touch-gesture-scroll-sideways-expected.txt: Added. Note: test has intentional platform difference.
     17
    1182012-07-11  Filip Pizlo  <fpizlo@apple.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r122396 r122399  
     12012-07-11  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
     4        https://bugs.webkit.org/show_bug.cgi?id=89580
     5
     6        WebKit GTK and Chromium Linux force vertical wheel events to
     7        scroll horizontally when over horizontal scroll bars.  This is
     8        undesirable for touchpad scrolling with
     9        hasPreciseScrollingDeltas() == true. Modified shouldTurnVerticalTicksIntoHorizontal
     10        to not perform this conversion for PlatformWheelEvents with preciseScrollingDeltas.
     11
     12        Reviewed by Adam Barth.
     13
     14        Tests: fast/events/touch/gesture/touch-gesture-scroll-sideways.html
     15
     16        * page/EventHandler.cpp:
     17        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
     18        (WebCore::EventHandler::handleWheelEvent):
     19        * page/EventHandler.h:
     20        (EventHandler):
     21        * page/chromium/EventHandlerChromium.cpp:
     22        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
     23        * page/gtk/EventHandlerGtk.cpp:
     24        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
     25
    1262012-07-11  Hayato Ito  <hayato@chromium.org>
    227
  • trunk/Source/WebCore/page/EventHandler.cpp

    r122224 r122399  
    22912291
    22922292#if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(UNIX) && !OS(DARWIN)))
    2293 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const
     2293bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const
    22942294{
    22952295    return false;
     
    23462346    // appropriately.
    23472347    PlatformWheelEvent event = e;
    2348     if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result))
     2348    if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result, e))
    23492349        event = event.copyTurningVerticalTicksIntoHorizontalTicks();
    23502350
  • trunk/Source/WebCore/page/EventHandler.h

    r121036 r122399  
    267267    bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
    268268   
    269     bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const;
     269    bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
    270270    bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
    271271
  • trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp

    r121036 r122399  
    159159// horizontal scrollbar while scrolling with the wheel.
    160160// This code comes from gtk/EventHandlerGtk.cpp.
    161 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
     161bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
    162162{
    163     return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
     163    return !event.hasPreciseScrollingDeltas() && result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
    164164}
    165165#endif
  • trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp

    r121036 r122399  
    127127// add the deltas and ticks here so that this behavior is consistent
    128128// for styled scrollbars.
    129 bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
     129bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent&) const
    130130{
    131131    return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
  • trunk/Tools/ChangeLog

    r122397 r122399  
     12012-07-11  Robert Kroeger  <rjkroege@chromium.org>
     2
     3        Suppress horizontal conversion of PlatformWheelEvents when hasPreciseScrollingDeltas is true
     4        https://bugs.webkit.org/show_bug.cgi?id=89580
     5
     6        WebKit GTK and Chromium Linux force vertical wheel events to
     7        scroll horizontally when over horizontal scroll bars.  This is
     8        undesirable for touchpad scrolling with
     9        hasPreciseScrollingDeltas() == true. Modified DumpRenderTree to
     10        let a layout test specify this attribute so that the change's impact
     11        on scrolling can be tested in a layout test.
     12
     13        Reviewed by Adam Barth.
     14
     15        * DumpRenderTree/chromium/EventSender.cpp:
     16        (EventSender::handleMouseWheel):
     17
    1182012-07-11  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Tools/DumpRenderTree/chromium/EventSender.cpp

    r122395 r122399  
    10441044    int vertical = arguments[1].toInt32();
    10451045    int paged = false;
     1046    int hasPreciseScrollingDeltas = false;
    10461047
    10471048    if (arguments.size() > 2 && arguments[2].isBool())
    10481049        paged = arguments[2].toBoolean();
     1050
     1051    if (arguments.size() > 3 && arguments[3].isBool())
     1052        hasPreciseScrollingDeltas = arguments[3].toBoolean();
    10491053
    10501054    WebMouseWheelEvent event;
     
    10551059    event.deltaY = event.wheelTicksY;
    10561060    event.scrollByPage = paged;
     1061    event.hasPreciseScrollingDeltas = hasPreciseScrollingDeltas;
     1062
    10571063    if (continuous) {
    10581064        event.wheelTicksX /= scrollbarPixelsPerTick;
Note: See TracChangeset for help on using the changeset viewer.