Commit bf29336f authored by eric@webkit.org's avatar eric@webkit.org

2010-05-30 Robert Hogan <robert@webkit.org>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Enhance Qt DRT implementation to support platform scroll wheel events.

        https://bugs.webkit.org/show_bug.cgi?id=36004

        Unskip:

        fast/events/remove-child-onscroll.html
        fast/events/platform-wheelevent-in-scrolling-div.html
        fast/events/continuous-platform-wheelevent-in-scrolling-div.html

        Add platform-specific results for Qt. Required because QWheelEvent only supports sending an event
        for scrolling movement one axis at a time. Naturally the test's check for the axis the event does
        not pertain to will 'fail' in such cases. So we get 6 lines of output in total, i.e.:

          FAIL event.wheelDeltaY should be -24000. Was 0.
          PASS event.wheelDeltaX is window.expectedScrollLeft*-120
          PASS event.wheelDelta is window.expectedScrollLeft*-120

        and then:

          PASS event.wheelDeltaY is window.expectedScrollTop*-120
          FAIL event.wheelDeltaX should be -12000. Was 0.
          PASS event.wheelDelta is window.expectedScrollTop*-120

        instead of just 3 like Mac:

          PASS event.wheelDeltaY is window.expectedScrollTop*-120
          PASS event.wheelDeltaX is window.expectedScrollLeft*-120
          PASS event.wheelDelta is window.expectedScrollTop*-120

        * platform/qt-linux/fast/events/continuous-platform-wheelevent-in-scrolling-div-expected.txt: Added.
        * platform/qt-linux/fast/events/platform-wheelevent-in-scrolling-div-expected.txt: Added.
        * platform/qt/Skipped:
2010-05-30  Robert Hogan  <robert@webkit.org>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Enhance Qt DRT implementation to support platform scroll wheel events.

        https://bugs.webkit.org/show_bug.cgi?id=36004

        Fix the bug in webkit.org/b/29601 for Qt.  A delta not divisible by 120
        indicates a device that is sending fine-resolution scroll events, so
        use the delta as the number of pixels to scroll.

        * platform/qt/WheelEventQt.cpp:
        (WebCore::PlatformWheelEvent::applyDelta):
2010-05-30  Robert Hogan  <robert@webkit.org>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt] Enhance Qt DRT implementation to support platform scroll wheel events.

        https://bugs.webkit.org/show_bug.cgi?id=36004

        * DumpRenderTree/qt/EventSenderQt.cpp:
        (EventSender::EventSender): QApplication::setWheelScrollLines(2) in order to match
                                    Scrollbar::pixelsPerLineStep() for DRT testing.
        (EventSender::mouseScrollBy): Added
        (EventSender::continuousMouseScrollBy): Added
        * DumpRenderTree/qt/EventSenderQt.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b22994f5
2010-05-30 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Enhance Qt DRT implementation to support platform scroll wheel events.
https://bugs.webkit.org/show_bug.cgi?id=36004
Unskip:
fast/events/remove-child-onscroll.html
fast/events/platform-wheelevent-in-scrolling-div.html
fast/events/continuous-platform-wheelevent-in-scrolling-div.html
Add platform-specific results for Qt. Required because QWheelEvent only supports sending an event
for scrolling movement one axis at a time. Naturally the test's check for the axis the event does
not pertain to will 'fail' in such cases. So we get 6 lines of output in total, i.e.:
FAIL event.wheelDeltaY should be -24000. Was 0.
PASS event.wheelDeltaX is window.expectedScrollLeft*-120
PASS event.wheelDelta is window.expectedScrollLeft*-120
and then:
PASS event.wheelDeltaY is window.expectedScrollTop*-120
FAIL event.wheelDeltaX should be -12000. Was 0.
PASS event.wheelDelta is window.expectedScrollTop*-120
instead of just 3 like Mac:
PASS event.wheelDeltaY is window.expectedScrollTop*-120
PASS event.wheelDeltaX is window.expectedScrollLeft*-120
PASS event.wheelDelta is window.expectedScrollTop*-120
* platform/qt-linux/fast/events/continuous-platform-wheelevent-in-scrolling-div-expected.txt: Added.
* platform/qt-linux/fast/events/platform-wheelevent-in-scrolling-div-expected.txt: Added.
* platform/qt/Skipped:
2010-05-29 Justin Schuh <jschuh@chromium.org>
Reviewed by Adam Barth.
......
......@@ -4960,12 +4960,6 @@ http/tests/cookies/third-party-cookie-relaxing.html
# For some reason crashes when run with all tests. Passes individually.
fast/forms/multiple-form-submission-protection-mouse.html
# https://bugs.webkit.org/show_bug.cgi?id=36004
# mouseScrollBy() and continuousMouseScrollBy() are not yet implemented in the Qt EventSender API.
fast/events/remove-child-onscroll.html
fast/events/platform-wheelevent-in-scrolling-div.html
fast/events/continuous-platform-wheelevent-in-scrolling-div.html
# It fails in DRT, but passes in QtLauncher
# https://bugs.webkit.org/show_bug.cgi?id=35921
editing/execCommand/move-selection-back-line.html
......
FAIL event.wheelDeltaY should be -24000. Was 0.
PASS event.wheelDeltaX is window.expectedScrollLeft*-120
PASS event.wheelDelta is window.expectedScrollLeft*-120
PASS event.wheelDeltaY is window.expectedScrollTop*-120
FAIL event.wheelDeltaX should be -12000. Was 0.
PASS event.wheelDelta is window.expectedScrollTop*-120
PASS div.scrollTop is window.expectedScrollTop
PASS div.scrollLeft is window.expectedScrollLeft
FAIL event.wheelDeltaY should be -600. Was 0.
PASS event.wheelDeltaX is window.expectedScrollLeft*-120
PASS event.wheelDelta is window.expectedScrollLeft*-120
PASS event.wheelDeltaY is window.expectedScrollTop*-120
FAIL event.wheelDeltaX should be -360. Was 0.
PASS event.wheelDelta is window.expectedScrollTop*-120
PASS div.scrollTop is window.expectedScrollTop*window.pixelsPerWheelTick
PASS div.scrollLeft is window.expectedScrollLeft*window.pixelsPerWheelTick
2010-05-30 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Enhance Qt DRT implementation to support platform scroll wheel events.
https://bugs.webkit.org/show_bug.cgi?id=36004
Fix the bug in webkit.org/b/29601 for Qt. A delta not divisible by 120
indicates a device that is sending fine-resolution scroll events, so
use the delta as the number of pixels to scroll.
* platform/qt/WheelEventQt.cpp:
(WebCore::PlatformWheelEvent::applyDelta):
2010-05-30 Jessie Berlin <jberlin@webkit.org>
Reviewed by Pavel Feldman.
......
......@@ -31,12 +31,17 @@ namespace WebCore {
void PlatformWheelEvent::applyDelta(int delta, Qt::Orientation orientation)
{
// A delta that is not mod 120 indicates a device that is sending
// fine-resolution scroll events, so use the delta as number of wheel ticks
// and number of pixels to scroll.See also webkit.org/b/29601
bool fullTick = !(delta % 120);
if (orientation == Qt::Horizontal) {
m_deltaX = (delta / 120.0f);
m_deltaX = (fullTick) ? delta / 120.0f : delta;
m_deltaY = 0;
} else {
m_deltaX = 0;
m_deltaY = (delta / 120.0f);
m_deltaY = (fullTick) ? delta / 120.0f : delta;
}
m_wheelTicksX = m_deltaX;
......@@ -46,8 +51,8 @@ void PlatformWheelEvent::applyDelta(int delta, Qt::Orientation orientation)
// (in QTextEditPrivate::init [h,v]bar->setSingleStep)
static const float cDefaultQtScrollStep = 20.f;
#ifndef QT_NO_WHEELEVENT
m_deltaX *= QApplication::wheelScrollLines() * cDefaultQtScrollStep;
m_deltaY *= QApplication::wheelScrollLines() * cDefaultQtScrollStep;
m_deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
m_deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
#endif
}
......
2010-05-30 Robert Hogan <robert@webkit.org>
Reviewed by Kenneth Rohde Christiansen.
[Qt] Enhance Qt DRT implementation to support platform scroll wheel events.
https://bugs.webkit.org/show_bug.cgi?id=36004
* DumpRenderTree/qt/EventSenderQt.cpp:
(EventSender::EventSender): QApplication::setWheelScrollLines(2) in order to match
Scrollbar::pixelsPerLineStep() for DRT testing.
(EventSender::mouseScrollBy): Added
(EventSender::continuousMouseScrollBy): Added
* DumpRenderTree/qt/EventSenderQt.h:
2010-05-28 Adam Barth <abarth@webkit.org>
Reviewed by David Levin.
......
......@@ -70,6 +70,9 @@ EventSender::EventSender(QWebPage* parent)
m_currentButton = 0;
resetClickCount();
m_page->view()->installEventFilter(this);
// So that we can match Scrollbar::pixelsPerLineStep() in WheelEventQt.cpp and
// pass fast/events/platform-wheelevent-in-scrolling-div.html
QApplication::setWheelScrollLines(2);
}
void EventSender::mouseDown(int button)
......@@ -155,6 +158,27 @@ void EventSender::mouseMoveTo(int x, int y)
sendOrQueueEvent(event);
}
#ifndef QT_NO_WHEELEVENT
void EventSender::mouseScrollBy(int x, int y)
{
continuousMouseScrollBy((x*120), (y*120));
}
void EventSender::continuousMouseScrollBy(int x, int y)
{
// continuousMouseScrollBy() mimics devices that send fine-grained scroll events where the 'delta' specified is not the usual
// multiple of 120. See http://doc.qt.nokia.com/4.6/qwheelevent.html#delta for a good explanation of this.
if (x) {
QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, x, m_mouseButtons, Qt::NoModifier, Qt::Horizontal);
sendOrQueueEvent(event);
}
if (y) {
QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, y, m_mouseButtons, Qt::NoModifier, Qt::Vertical);
sendOrQueueEvent(event);
}
}
#endif
void EventSender::leapForward(int ms)
{
eventQueue[endOfQueue].m_delay = ms;
......
......@@ -57,6 +57,10 @@ public slots:
void mouseDown(int button = 0);
void mouseUp(int button = 0);
void mouseMoveTo(int x, int y);
#ifndef QT_NO_WHEELEVENT
void mouseScrollBy(int x, int y);
void continuousMouseScrollBy(int x, int y);
#endif
void leapForward(int ms);
void keyDown(const QString& string, const QStringList& modifiers = QStringList(), unsigned int location = 0);
void clearKillRing() {}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment