<rdar://problem/7694674> Hover states not updated when overflow section scrolls under...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Mar 2010 17:06:39 +0000 (17:06 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Mar 2010 17:06:39 +0000 (17:06 +0000)
commite0e642353b11fb16b7b956165156a0fdb79c0294
treed38868481058c47d1bfb6455952cba724244fe3c
parente2fd7e0e67a4c47c6b7453188b455616a97d9290
<rdar://problem/7694674> Hover states not updated when overflow section scrolls under stationary mouse pointer
https://bugs.webkit.org/show_bug.cgi?id=35949

Reviewed by Darin Adler.

WebCore:

Test: fast/events/overflow-scroll-fake-mouse-move.html

Soon after an overflow section scrolls under the mouse pointer, dispatch
a fake mouse move event. This is similar to how frame scrolling is handled
in WebKit, and has the effect of updating hover state, dispatching DOM mouse
events, and updating the tool tip.

* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler): Initialize m_fakeMouseMoveEventTimer.
(WebCore::EventHandler::~EventHandler): Assert that the timer is not active.
(WebCore::EventHandler::clear): Stop the timer.
(WebCore::EventHandler::handleMousePressEvent): Cancel pending fake mouse
move events.
(WebCore::EventHandler::handleMouseMoveEvent): Ditto.
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): If the mouse
is in the passed-in quad, ensure that a fake mouse move event is scheduled
to fire soon.
(WebCore::EventHandler::cancelFakeMouseMoveEvent): Does what the name says.
(WebCore::EventHandler::fakeMouseMoveEventTimerFired): Constructs a
PlatformMouseEvent with the current mouse location, modifier key state and
time stamp and calls mouseMoved().
* page/EventHandler.h:
* platform/PlatformKeyboardEvent.h: Declared getCurrentModifierState().
* platform/android/KeyEventAndroid.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
* platform/brew/PlatformKeyboardEventBrew.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
* platform/chromium/PlatformKeyboardEventChromium.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
* platform/efl/PlatformKeyboardEventEfl.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
* platform/gtk/KeyEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
* platform/haiku/PlatformKeyboardEventHaiku.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
* platform/qt/PlatformKeyboardEventQt.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out.
* platform/win/KeyEventWin.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added.
* platform/wx/KeyboardEventWx.cpp:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset): Call
EventHandler::dispatchFakeMouseMoveEventSoonInQuad(). Moved things around
a little to avoid computing the repaint rect twice.

LayoutTests:

* fast/events/overflow-scroll-fake-mouse-move-expected.txt: Added.
* fast/events/overflow-scroll-fake-mouse-move.html: Added.
* fast/events/touch/basic-multi-touch-events.html:
* fast/events/touch/basic-single-touch-events.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/overflow-scroll-fake-mouse-move-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/overflow-scroll-fake-mouse-move.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/EventHandler.cpp
WebCore/page/EventHandler.h
WebCore/platform/PlatformKeyboardEvent.h
WebCore/platform/android/KeyEventAndroid.cpp
WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
WebCore/platform/gtk/KeyEventGtk.cpp
WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
WebCore/platform/mac/KeyEventMac.mm
WebCore/platform/qt/PlatformKeyboardEventQt.cpp
WebCore/platform/win/KeyEventWin.cpp
WebCore/platform/wx/KeyboardEventWx.cpp
WebCore/rendering/RenderLayer.cpp