Changeset 85808 in webkit
- Timestamp:
- May 4, 2011 4:49:36 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r85806 r85808 1 2011-05-04 Jeff Miller <jeffm@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Send unhandled wheel events to parent window on Windows 6 https://bugs.webkit.org/show_bug.cgi?id=60220 7 8 Keep track of wheel events using NativeWebWheelEvent instead of WebWheelEvent in WebPageProxy 9 so we can send the native event to the parent window if WebKit doesn't handle it. 10 11 * UIProcess/API/mac/WKView.mm: Use NativeWebWheelEvent instead of WebWheelEvent. 12 13 * UIProcess/API/qt/qwkpage.cpp: 14 (QWKPagePrivate::wheelEvent): Use NativeWebWheelEvent instead of WebWheelEvent. 15 16 * UIProcess/WebPageProxy.cpp: 17 (WebKit::WebPageProxy::WebPageProxy): Removed initialization of obsolete m_processingWheelEvent member variable. 18 (WebKit::coalesceWheelEvents): Use NativeWebWheelEvent instead of WebWheelEvent and add a note that this won't work if we ever enable MERGE_WHEEL_EVENTS. 19 (WebKit::WebPageProxy::handleWheelEvent): Use NativeWebWheelEvent instead of WebWheelEvent, keep track of the current event in m_currentlyProcessedWheelEvent. 20 (WebKit::WebPageProxy::didReceiveEvent): Call wheelEventNotHandled() on Windows if wheel event is not handled. 21 (WebKit::WebPageProxy::processDidCrash): Clear out m_currentlyProcessedWheelEvent. 22 * UIProcess/WebPageProxy.h: Change handleWheelEvent() to take a NativeWebWheelEvent, added wheelEventNotHandled() on Windows, remove m_processingWheelEvent, add m_currentlyProcessedWheelEvent. 23 24 * UIProcess/win/WebPageProxyWin.cpp: 25 (WebKit::WebPageProxy::wheelEventNotHandled): Added. 26 27 * UIProcess/win/WebView.cpp: 28 (WebKit::WebView::onWheelEvent): Use NativeWebWheelEvent instead of WebWheelEvent. 29 1 30 2011-05-04 Anders Carlsson <andersca@apple.com> 2 31 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r85515 r85808 38 38 #import "NativeWebKeyboardEvent.h" 39 39 #import "NativeWebMouseEvent.h" 40 #import "NativeWebWheelEvent.h" 40 41 #import "PDFViewController.h" 41 42 #import "PageClientImpl.h" … … 995 996 #undef NATIVE_MOUSE_EVENT_HANDLER 996 997 997 #define EVENT_HANDLER(Selector, Type) \998 #define NATIVE_EVENT_HANDLER(Selector, Type) \ 998 999 - (void)Selector:(NSEvent *)theEvent \ 999 1000 { \ 1000 Web##Type##Event webEvent = WebEventFactory::createWeb##Type##Event(theEvent, self); \1001 NativeWeb##Type##Event webEvent = NativeWeb##Type##Event(theEvent, self); \ 1001 1002 _data->_page->handle##Type##Event(webEvent); \ 1002 1003 } 1003 1004 1004 EVENT_HANDLER(scrollWheel, Wheel)1005 1006 #undef EVENT_HANDLER1005 NATIVE_EVENT_HANDLER(scrollWheel, Wheel) 1006 1007 #undef NATIVE_EVENT_HANDLER 1007 1008 1008 1009 - (void)mouseMoved:(NSEvent *)event -
trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
r85584 r85808 37 37 #include "NativeWebKeyboardEvent.h" 38 38 #include "NativeWebMouseEvent.h" 39 #include "NativeWebWheelEvent.h" 39 40 #include "NotImplemented.h" 40 41 #include "Region.h" … … 339 340 void QWKPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev) 340 341 { 341 WebWheelEvent wheelEvent = WebEventFactory::createWebWheelEvent(ev); 342 page->handleWheelEvent(wheelEvent); 342 page->handleWheelEvent(NativeWebWheelEvent(ev)); 343 343 } 344 344 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r85746 r85808 36 36 #include "NativeWebKeyboardEvent.h" 37 37 #include "NativeWebMouseEvent.h" 38 #include "NativeWebWheelEvent.h" 38 39 #include "PageClient.h" 39 40 #include "PrintInfo.h" … … 139 140 , m_syncNavigationActionPolicyAction(PolicyUse) 140 141 , m_syncNavigationActionPolicyDownloadID(0) 141 , m_processingWheelEvent(false)142 142 , m_processingMouseMoveEvent(false) 143 143 , m_pageID(pageID) … … 870 870 } 871 871 872 static PassOwnPtr< WebWheelEvent> coalesceWheelEvents(WebWheelEvent* oldNextWheelEvent, constWebWheelEvent& newWheelEvent)872 static PassOwnPtr<NativeWebWheelEvent> coalesceWheelEvents(NativeWebWheelEvent* oldNextWheelEvent, const NativeWebWheelEvent& newWheelEvent) 873 873 { 874 874 #if MERGE_WHEEL_EVENTS 875 875 // Merge model: Combine wheel event deltas (and wheel ticks) into a single wheel event. 876 876 if (!oldNextWheelEvent) 877 return adoptPtr(new WebWheelEvent(newWheelEvent));877 return adoptPtr(new NativeWebWheelEvent(newWheelEvent)); 878 878 879 879 if (oldNextWheelEvent->position() != newWheelEvent.position() || oldNextWheelEvent->modifiers() != newWheelEvent.modifiers() || oldNextWheelEvent->granularity() != newWheelEvent.granularity()) 880 return adoptPtr(new WebWheelEvent(newWheelEvent));880 return adoptPtr(new NativeWebWheelEvent(newWheelEvent)); 881 881 882 882 FloatSize mergedDelta = oldNextWheelEvent->delta() + newWheelEvent.delta(); 883 883 FloatSize mergedWheelTicks = oldNextWheelEvent->wheelTicks() + newWheelEvent.wheelTicks(); 884 884 885 return adoptPtr(new WebWheelEvent(WebEvent::Wheel, newWheelEvent.position(), newWheelEvent.globalPosition(), mergedDelta, mergedWheelTicks, newWheelEvent.granularity(), newWheelEvent.modifiers(), newWheelEvent.timestamp())); 885 // FIXME: This won't compile, if we ever turn on MERGE_WHEEL_EVENTS we'll have to generate a NativeWebWheelEvent synthetically for each platform. 886 return adoptPtr(new NativeWebWheelEvent(WebEvent::Wheel, newWheelEvent.position(), newWheelEvent.globalPosition(), mergedDelta, mergedWheelTicks, newWheelEvent.granularity(), newWheelEvent.modifiers(), newWheelEvent.timestamp())); 886 887 #else 887 888 // Simple model: Just keep the last event, dropping all interim events. 888 return adoptPtr(new WebWheelEvent(newWheelEvent));889 #endif 890 } 891 892 void WebPageProxy::handleWheelEvent(const WebWheelEvent& event)893 { 894 if (!isValid()) 895 return; 896 897 if (m_ processingWheelEvent) {889 return adoptPtr(new NativeWebWheelEvent(newWheelEvent)); 890 #endif 891 } 892 893 void WebPageProxy::handleWheelEvent(const NativeWebWheelEvent& event) 894 { 895 if (!isValid()) 896 return; 897 898 if (m_currentlyProcessedWheelEvent) { 898 899 m_nextWheelEvent = coalesceWheelEvents(m_nextWheelEvent.get(), event); 899 900 return; 900 901 } 902 903 m_currentlyProcessedWheelEvent = adoptPtr(new NativeWebWheelEvent(event)); 901 904 902 905 process()->responsivenessTimer()->start(); 903 906 process()->send(Messages::WebPage::WheelEvent(event), m_pageID); 904 m_processingWheelEvent = true;905 907 } 906 908 … … 2624 2626 2625 2627 case WebEvent::Wheel: { 2626 m_processingWheelEvent = false; 2628 ASSERT(m_currentlyProcessedWheelEvent); 2629 2630 #if PLATFORM(WIN) 2631 if (!handled && m_currentlyProcessedWheelEvent) 2632 wheelEventNotHandled(*m_currentlyProcessedWheelEvent); 2633 #endif 2634 2635 m_currentlyProcessedWheelEvent = nullptr; 2627 2636 if (m_nextWheelEvent) { 2628 2637 handleWheelEvent(*m_nextWheelEvent); … … 2842 2851 m_keyEventQueue.clear(); 2843 2852 m_nextWheelEvent = nullptr; 2853 m_currentlyProcessedWheelEvent = nullptr; 2844 2854 m_nextMouseMoveEvent = nullptr; 2845 2855 m_currentlyProcessedMouseDownEvent = nullptr; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r85795 r85808 88 88 class NativeWebKeyboardEvent; 89 89 class NativeWebMouseEvent; 90 class NativeWebWheelEvent; 90 91 class PageClient; 91 92 class PlatformCertificateInfo; … … 307 308 308 309 void handleMouseEvent(const NativeWebMouseEvent&); 309 void handleWheelEvent(const WebWheelEvent&);310 void handleWheelEvent(const NativeWebWheelEvent&); 310 311 void handleKeyboardEvent(const NativeWebKeyboardEvent&); 311 312 #if ENABLE(GESTURE_EVENTS) … … 692 693 void stopResponsivenessTimer(); 693 694 695 #if PLATFORM(WIN) 696 void wheelEventNotHandled(NativeWebWheelEvent&) const; 697 #endif 698 694 699 void voidCallback(uint64_t); 695 700 void dataCallback(const CoreIPC::DataReference&, uint64_t); … … 834 839 Deque<NativeWebKeyboardEvent> m_keyEventQueue; 835 840 bool m_processingWheelEvent; 836 OwnPtr<WebWheelEvent> m_nextWheelEvent; 841 OwnPtr<NativeWebWheelEvent> m_currentlyProcessedWheelEvent; 842 OwnPtr<NativeWebWheelEvent> m_nextWheelEvent; 837 843 838 844 bool m_processingMouseMoveEvent; -
trunk/Source/WebKit2/UIProcess/win/WebPageProxyWin.cpp
r85795 r85808 27 27 #include "WebPageProxy.h" 28 28 29 #include "NativeWebWheelEvent.h" 29 30 #include "PageClient.h" 30 31 #include "WebPopupMenuProxyWin.h" … … 76 77 } 77 78 79 void WebPageProxy::wheelEventNotHandled(NativeWebWheelEvent& event) const 80 { 81 const MSG* msg = event.nativeEvent(); 82 ::PostMessage(::GetParent(nativeWindow()), msg->message, msg->wParam, msg->lParam); 83 } 84 78 85 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/win/WebView.cpp
r85795 r85808 33 33 #include "NativeWebKeyboardEvent.h" 34 34 #include "NativeWebMouseEvent.h" 35 #include "NativeWebWheelEvent.h" 35 36 #include "Region.h" 36 37 #include "RunLoop.h" … … 435 436 LRESULT WebView::onWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled) 436 437 { 437 WebWheelEvent wheelEvent = WebEventFactory::createWebWheelEvent(hWnd, message, wParam, lParam);438 NativeWebWheelEvent wheelEvent(hWnd, message, wParam, lParam); 438 439 if (wheelEvent.controlKey()) { 439 440 // We do not want WebKit to handle Control + Wheel, this should be handled by the client application
Note: See TracChangeset
for help on using the changeset viewer.