Changeset 55909 in webkit
- Timestamp:
- Mar 12, 2010, 9:06:39 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55907 r55909 1 2010-03-12 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/7694674> Hover states not updated when overflow section scrolls under stationary mouse pointer 6 https://bugs.webkit.org/show_bug.cgi?id=35949 7 8 * fast/events/overflow-scroll-fake-mouse-move-expected.txt: Added. 9 * fast/events/overflow-scroll-fake-mouse-move.html: Added. 10 * fast/events/touch/basic-multi-touch-events.html: 11 * fast/events/touch/basic-single-touch-events.html: 12 1 13 2010-03-12 Csaba Osztrogonác <ossy@webkit.org> 2 14 -
trunk/WebCore/ChangeLog
r55896 r55909 1 2010-03-12 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Darin Adler. 4 5 <rdar://problem/7694674> Hover states not updated when overflow section scrolls under stationary mouse pointer 6 https://bugs.webkit.org/show_bug.cgi?id=35949 7 8 Test: fast/events/overflow-scroll-fake-mouse-move.html 9 10 Soon after an overflow section scrolls under the mouse pointer, dispatch 11 a fake mouse move event. This is similar to how frame scrolling is handled 12 in WebKit, and has the effect of updating hover state, dispatching DOM mouse 13 events, and updating the tool tip. 14 15 * page/EventHandler.cpp: 16 (WebCore::EventHandler::EventHandler): Initialize m_fakeMouseMoveEventTimer. 17 (WebCore::EventHandler::~EventHandler): Assert that the timer is not active. 18 (WebCore::EventHandler::clear): Stop the timer. 19 (WebCore::EventHandler::handleMousePressEvent): Cancel pending fake mouse 20 move events. 21 (WebCore::EventHandler::handleMouseMoveEvent): Ditto. 22 (WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): If the mouse 23 is in the passed-in quad, ensure that a fake mouse move event is scheduled 24 to fire soon. 25 (WebCore::EventHandler::cancelFakeMouseMoveEvent): Does what the name says. 26 (WebCore::EventHandler::fakeMouseMoveEventTimerFired): Constructs a 27 PlatformMouseEvent with the current mouse location, modifier key state and 28 time stamp and calls mouseMoved(). 29 * page/EventHandler.h: 30 * platform/PlatformKeyboardEvent.h: Declared getCurrentModifierState(). 31 * platform/android/KeyEventAndroid.cpp: 32 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. 33 * platform/brew/PlatformKeyboardEventBrew.cpp: 34 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. 35 * platform/chromium/PlatformKeyboardEventChromium.cpp: 36 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. 37 * platform/efl/PlatformKeyboardEventEfl.cpp: 38 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. 39 * platform/gtk/KeyEventGtk.cpp: 40 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. 41 * platform/haiku/PlatformKeyboardEventHaiku.cpp: 42 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. 43 * platform/mac/KeyEventMac.mm: 44 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. 45 * platform/qt/PlatformKeyboardEventQt.cpp: 46 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Stubbed out. 47 * platform/win/KeyEventWin.cpp: 48 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Added. 49 * platform/wx/KeyboardEventWx.cpp: 50 (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Ditto. 51 * rendering/RenderLayer.cpp: 52 (WebCore::RenderLayer::scrollToOffset): Call 53 EventHandler::dispatchFakeMouseMoveEventSoonInQuad(). Moved things around 54 a little to avoid computing the repaint rect twice. 55 1 56 2010-03-12 Kent Hansen <kent.hansen@nokia.com> 2 57 -
trunk/WebCore/page/EventHandler.cpp
r55843 r55909 68 68 #include "WheelEvent.h" 69 69 #include "htmlediting.h" // for comparePositions() 70 #include <wtf/CurrentTime.h> 70 71 #include <wtf/StdLibExtras.h> 71 72 … … 106 107 // When the autoscroll or the panScroll is triggered when do the scroll every 0.05s to make it smooth 107 108 const double autoscrollInterval = 0.05; 109 110 const double fakeMouseMoveInterval = 0.1; 108 111 109 112 static Frame* subframeForHitTestResult(const MouseEventWithHitTestResults&); … … 169 172 , m_mouseDownMayStartAutoscroll(false) 170 173 , m_mouseDownWasInSubframe(false) 174 , m_fakeMouseMoveEventTimer(this, &EventHandler::fakeMouseMoveEventTimerFired) 171 175 #if ENABLE(SVG) 172 176 , m_svgPan(false) … … 188 192 EventHandler::~EventHandler() 189 193 { 194 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); 190 195 } 191 196 … … 201 206 { 202 207 m_hoverTimer.stop(); 208 m_fakeMouseMoveEventTimer.stop(); 203 209 m_resizeLayer = 0; 204 210 m_nodeUnderMouse = 0; … … 375 381 dragState().m_dragSrc = 0; 376 382 #endif 383 384 cancelFakeMouseMoveEvent(); 377 385 378 386 if (ScrollView* scrollView = m_frame->view()) { … … 1151 1159 RefPtr<FrameView> protector(m_frame->view()); 1152 1160 1161 cancelFakeMouseMoveEvent(); 1153 1162 m_mousePressed = true; 1154 1163 m_capturesDragging = true; … … 1341 1350 if (m_hoverTimer.isActive()) 1342 1351 m_hoverTimer.stop(); 1352 1353 cancelFakeMouseMoveEvent(); 1343 1354 1344 1355 #if ENABLE(SVG) … … 1942 1953 if (!m_hoverTimer.isActive()) 1943 1954 m_hoverTimer.startOneShot(0); 1955 } 1956 1957 void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad) 1958 { 1959 FrameView* view = m_frame->view(); 1960 if (!view) 1961 return; 1962 1963 if (m_mousePressed || !quad.containsPoint(view->windowToContents(m_currentMousePosition))) 1964 return; 1965 1966 if (!m_fakeMouseMoveEventTimer.isActive()) 1967 m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveInterval); 1968 } 1969 1970 void EventHandler::cancelFakeMouseMoveEvent() 1971 { 1972 m_fakeMouseMoveEventTimer.stop(); 1973 } 1974 1975 void EventHandler::fakeMouseMoveEventTimerFired(Timer<EventHandler>* timer) 1976 { 1977 ASSERT_UNUSED(timer, timer == &m_fakeMouseMoveEventTimer); 1978 ASSERT(!m_mousePressed); 1979 1980 FrameView* view = m_frame->view(); 1981 if (!view) 1982 return; 1983 1984 bool shiftKey; 1985 bool ctrlKey; 1986 bool altKey; 1987 bool metaKey; 1988 PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); 1989 IntPoint globalPoint = view->contentsToScreen(IntRect(view->windowToContents(m_currentMousePosition), IntSize())).location(); 1990 PlatformMouseEvent fakeMouseMoveEvent(m_currentMousePosition, globalPoint, NoButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime()); 1991 mouseMoved(fakeMouseMoveEvent); 1944 1992 } 1945 1993 -
trunk/WebCore/page/EventHandler.h
r55543 r55909 51 51 class EventTarget; 52 52 class FloatPoint; 53 class FloatQuad; 53 54 class Frame; 54 55 class HitTestRequest; … … 103 104 void updateAutoscrollRenderer(); 104 105 106 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); 107 105 108 HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars); 106 109 … … 267 270 void autoscrollTimerFired(Timer<EventHandler>*); 268 271 272 void fakeMouseMoveEventTimerFired(Timer<EventHandler>*); 273 void cancelFakeMouseMoveEvent(); 274 269 275 void invalidateClick(); 270 276 … … 374 380 bool m_mouseDownWasInSubframe; 375 381 382 Timer<EventHandler> m_fakeMouseMoveEventTimer; 383 376 384 #if ENABLE(SVG) 377 385 bool m_svgPan; -
trunk/WebCore/platform/PlatformKeyboardEvent.h
r55633 r55909 156 156 157 157 static bool currentCapsLockState(); 158 static void getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey); 158 159 159 160 #if PLATFORM(MAC) -
trunk/WebCore/platform/android/KeyEventAndroid.cpp
r50971 r55909 252 252 } 253 253 254 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 255 { 256 notImplemented(); 257 shiftKey = false; 258 ctrlKey = false; 259 altKey = false; 260 metaKey = false; 261 } 262 254 263 void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode) 255 264 { -
trunk/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp
r54930 r55909 171 171 } 172 172 173 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 174 { 175 notImplemented(); 176 shiftKey = false; 177 ctrlKey = false; 178 altKey = false; 179 metaKey = false; 180 } 181 173 182 } // namespace WebCore 174 -
trunk/WebCore/platform/chromium/PlatformKeyboardEventChromium.cpp
r52791 r55909 83 83 } 84 84 85 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 86 { 87 #if OS(WINDOWS) 88 shiftKey = GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT; 89 ctrlKey = GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT; 90 altKey = GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT; 91 metaKey = false; 92 #elif OS(DARWIN) 93 UInt32 currentModifiers = GetCurrentKeyModifiers(); 94 shiftKey = currentModifiers & ::shiftKey; 95 ctrlKey = currentModifiers & ::controlKey; 96 altKey = currentModifiers & ::optionKey; 97 metaKey = currentModifiers & ::cmdKey; 98 #else 99 notImplemented(); 100 #endif 101 } 102 85 103 } // namespace WebCore -
trunk/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
r55345 r55909 242 242 } 243 243 244 } 244 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 245 { 246 notImplemented(); 247 shiftKey = false; 248 ctrlKey = false; 249 altKey = false; 250 metaKey = false; 251 } 252 253 } -
trunk/WebCore/platform/gtk/KeyEventGtk.cpp
r53942 r55909 587 587 } 588 588 589 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 590 { 591 notImplemented(); 592 shiftKey = false; 593 ctrlKey = false; 594 altKey = false; 595 metaKey = false; 596 } 597 589 598 GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const 590 599 { -
trunk/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
r55138 r55909 378 378 } 379 379 380 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 381 { 382 unit32 modifiers = ::modifiers(); 383 shiftKey = modifiers & B_SHIFT_KEY; 384 ctrlKey = modifiers & B_COMMAND_KEY; 385 altKey = modifiers & B_CONTROL_KEY; 386 metaKey = modifiers & B_OPTION_KEY; 387 } 388 380 389 } // namespace WebCore 381 390 -
trunk/WebCore/platform/mac/KeyEventMac.mm
r55431 r55909 1 1 /* 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2004, 2006, 2007, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 877 877 } 878 878 879 } 879 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 880 { 881 UInt32 currentModifiers = GetCurrentKeyModifiers(); 882 shiftKey = currentModifiers & ::shiftKey; 883 ctrlKey = currentModifiers & ::controlKey; 884 altKey = currentModifiers & ::optionKey; 885 metaKey = currentModifiers & ::cmdKey; 886 } 887 888 } -
trunk/WebCore/platform/qt/PlatformKeyboardEventQt.cpp
r55501 r55909 552 552 } 553 553 554 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 555 { 556 notImplemented(); 557 shiftKey = false; 558 ctrlKey = false; 559 altKey = false; 560 metaKey = false; 561 } 562 554 563 } 555 564 -
trunk/WebCore/platform/win/KeyEventWin.cpp
r37335 r55909 1 1 /* 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 215 215 } 216 216 217 } 217 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 218 { 219 shiftKey = GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT; 220 ctrlKey = GetKeyState(VK_CONTROL) & HIGH_BIT_MASK_SHORT; 221 altKey = GetKeyState(VK_MENU) & HIGH_BIT_MASK_SHORT; 222 metaKey = false; 223 } 224 225 } -
trunk/WebCore/platform/wx/KeyboardEventWx.cpp
r43265 r55909 389 389 } 390 390 391 } 392 391 void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) 392 { 393 shiftKey = wxGetKeyState(WXK_SHIFT); 394 ctrlKey = wxGetKeyState(WXK_CONTROL); 395 altKey = wxGetKeyState(WXK_ALT); 396 metaKey = false; 397 } 398 399 } 400 -
trunk/WebCore/rendering/RenderLayer.cpp
r55597 r55909 1 1 /* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 3 3 * 4 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. … … 1236 1236 } 1237 1237 1238 // The caret rect needs to be invalidated after scrolling 1238 RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint(); 1239 IntRect rectForRepaint = renderer()->clippedOverflowRectForRepaint(repaintContainer); 1240 1239 1241 Frame* frame = renderer()->document()->frame(); 1240 if (frame) 1242 if (frame) { 1243 // The caret rect needs to be invalidated after scrolling 1241 1244 frame->selection()->setNeedsLayout(); 1242 1245 1246 FloatQuad quadForFakeMouseMoveEvent = FloatQuad(rectForRepaint); 1247 if (repaintContainer) 1248 quadForFakeMouseMoveEvent = repaintContainer->localToAbsoluteQuad(quadForFakeMouseMoveEvent); 1249 frame->eventHandler()->dispatchFakeMouseMoveEventSoonInQuad(quadForFakeMouseMoveEvent); 1250 } 1251 1243 1252 // Just schedule a full repaint of our object. 1244 if ( repaint)1245 renderer()->repaint ();1246 1253 if (view && repaint) 1254 renderer()->repaintUsingContainer(repaintContainer, rectForRepaint); 1255 1247 1256 if (updateScrollbars) { 1248 1257 if (m_hBar)
Note:
See TracChangeset
for help on using the changeset viewer.