Changeset 157319 in webkit
- Timestamp:
- Oct 11, 2013 2:14:06 PM (11 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/CMakeLists.txt
r157254 r157319 190 190 Shared/WebEventConversion.cpp 191 191 Shared/WebGeolocationPosition.cpp 192 Shared/WebGestureEvent.cpp193 192 Shared/WebGraphicsContext.cpp 194 193 Shared/WebHitTestResult.cpp -
trunk/Source/WebKit2/ChangeLog
r157310 r157319 1 2013-10-11 Anders Carlsson <andersca@apple.com> 2 3 Remove ENABLE(GESTURE_EVENTS) from WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=122673 5 6 Reviewed by Ryosuke Niwa. 7 8 * Shared/WebEvent.h: 9 * Shared/WebEventConversion.cpp: 10 * Shared/WebEventConversion.h: 11 * Shared/WebGestureEvent.cpp: Removed. 12 * Shared/mac/WebEventFactory.h: 13 * Shared/mac/WebEventFactory.mm: 14 * UIProcess/API/mac/PageClientImpl.h: 15 * UIProcess/API/mac/PageClientImpl.mm: 16 * UIProcess/API/mac/WKView.mm: 17 (-[WKView viewDidMoveToWindow]): 18 * UIProcess/PageClient.h: 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::didReceiveEvent): 21 (WebKit::WebPageProxy::resetStateAfterProcessExited): 22 * UIProcess/WebPageProxy.h: 23 * WebKit2.xcodeproj/project.pbxproj: 24 * WebProcess/WebPage/EventDispatcher.cpp: 25 * WebProcess/WebPage/EventDispatcher.h: 26 * WebProcess/WebPage/EventDispatcher.messages.in: 27 * WebProcess/WebPage/WebPage.cpp: 28 * WebProcess/WebPage/WebPage.h: 29 1 30 2013-10-11 Adam Roben <aroben@webkit.org> 2 31 -
trunk/Source/WebKit2/Shared/WebEvent.h
r141619 r157319 63 63 Char, 64 64 65 #if ENABLE(GESTURE_EVENTS)66 // WebGestureEvent67 GestureScrollBegin,68 GestureScrollEnd,69 GestureSingleTap,70 #endif71 72 65 #if ENABLE(TOUCH_EVENTS) 73 66 // WebTouchEvent … … 246 239 }; 247 240 248 249 #if ENABLE(GESTURE_EVENTS)250 // FIXME: Move this class to its own header file.251 class WebGestureEvent : public WebEvent {252 public:253 WebGestureEvent() { }254 WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp);255 WebGestureEvent(Type, const WebCore::IntPoint& position, const WebCore::IntPoint& globalPosition, Modifiers, double timestamp, const WebCore::IntSize& area, const WebCore::FloatPoint& delta);256 257 const WebCore::IntPoint position() const { return m_position; }258 const WebCore::IntPoint globalPosition() const { return m_globalPosition; }259 const WebCore::IntSize area() const { return m_area; }260 const WebCore::FloatPoint delta() const { return m_delta; }261 262 void encode(CoreIPC::ArgumentEncoder&) const;263 static bool decode(CoreIPC::ArgumentDecoder&, WebGestureEvent&);264 265 private:266 static bool isGestureEventType(Type);267 268 WebCore::IntPoint m_position;269 WebCore::IntPoint m_globalPosition;270 WebCore::IntSize m_area;271 WebCore::FloatPoint m_delta;272 };273 #endif // ENABLE(GESTURE_EVENTS)274 275 276 241 #if ENABLE(TOUCH_EVENTS) 277 242 // FIXME: Move this class to its own header file. -
trunk/Source/WebKit2/Shared/WebEventConversion.cpp
r139023 r157319 197 197 } 198 198 199 #if ENABLE(GESTURE_EVENTS)200 class WebKit2PlatformGestureEvent : public WebCore::PlatformGestureEvent {201 public:202 WebKit2PlatformGestureEvent(const WebGestureEvent& webEvent)203 {204 // PlatformEvent205 switch (webEvent.type()) {206 case WebEvent::GestureScrollBegin:207 m_type = WebCore::PlatformEvent::GestureScrollBegin;208 break;209 case WebEvent::GestureScrollEnd:210 m_type = WebCore::PlatformEvent::GestureScrollEnd;211 break;212 case WebEvent::GestureSingleTap:213 m_type = WebCore::PlatformEvent::GestureTap;214 break;215 default:216 ASSERT_NOT_REACHED();217 }218 219 m_modifiers = 0;220 if (webEvent.shiftKey())221 m_modifiers |= ShiftKey;222 if (webEvent.controlKey())223 m_modifiers |= CtrlKey;224 if (webEvent.altKey())225 m_modifiers |= AltKey;226 if (webEvent.metaKey())227 m_modifiers |= MetaKey;228 229 m_timestamp = webEvent.timestamp();230 231 // PlatformGestureEvent232 m_position = webEvent.position();233 m_globalPosition = webEvent.globalPosition();234 235 m_area = webEvent.area();236 m_deltaX = webEvent.delta().x();237 m_deltaY = webEvent.delta().y();238 }239 };240 241 WebCore::PlatformGestureEvent platform(const WebGestureEvent& webEvent)242 {243 return WebKit2PlatformGestureEvent(webEvent);244 }245 #endif246 247 199 #if ENABLE(TOUCH_EVENTS) 248 200 class WebKit2PlatformTouchPoint : public WebCore::PlatformTouchPoint { -
trunk/Source/WebKit2/Shared/WebEventConversion.h
r95901 r157319 31 31 #include <WebCore/PlatformWheelEvent.h> 32 32 33 #if ENABLE(GESTURE_EVENTS)34 #include <WebCore/PlatformGestureEvent.h>35 #endif36 37 33 #if ENABLE(TOUCH_EVENTS) 38 34 #include <WebCore/PlatformTouchEvent.h> … … 46 42 class WebKeyboardEvent; 47 43 48 #if ENABLE(GESTURE_EVENTS)49 class WebGestureEvent;50 #endif51 52 44 #if ENABLE(TOUCH_EVENTS) 53 45 class WebTouchEvent; … … 59 51 WebCore::PlatformKeyboardEvent platform(const WebKeyboardEvent&); 60 52 61 #if ENABLE(GESTURE_EVENTS)62 WebCore::PlatformGestureEvent platform(const WebGestureEvent&);63 #endif64 65 53 #if ENABLE(TOUCH_EVENTS) 66 54 WebCore::PlatformTouchEvent platform(const WebTouchEvent&); -
trunk/Source/WebKit2/Shared/mac/WebEventFactory.h
r119349 r157319 40 40 static WebWheelEvent createWebWheelEvent(NSEvent *event, NSView *windowView); 41 41 static WebKeyboardEvent createWebKeyboardEvent(NSEvent *event, NSView *windowView); 42 43 #if ENABLE(GESTURE_EVENTS)44 static WebGestureEvent createWebGestureEvent(NSEvent *event, NSView *windowView);45 #endif46 42 #endif // USE(APPKIT) 47 43 }; -
trunk/Source/WebKit2/Shared/mac/WebEventFactory.mm
r156860 r157319 240 240 return static_cast<WebWheelEvent::Phase>(phase); 241 241 } 242 243 #if ENABLE(GESTURE_EVENTS)244 static WebEvent::Type gestureEventTypeForEvent(NSEvent *event)245 {246 switch ([event type]) {247 case NSEventTypeBeginGesture:248 return WebEvent::GestureScrollBegin;249 case NSEventTypeEndGesture:250 return WebEvent::GestureScrollEnd;251 default:252 ASSERT_NOT_REACHED();253 return WebEvent::GestureScrollEnd;254 }255 }256 #endif257 242 258 243 static inline String textFromEvent(NSEvent* event) … … 463 448 } 464 449 465 #if ENABLE(GESTURE_EVENTS)466 WebGestureEvent WebEventFactory::createWebGestureEvent(NSEvent *event, NSView *windowView)467 {468 WebEvent::Type type = gestureEventTypeForEvent(event);469 NSPoint position = pointForEvent(event, windowView);470 NSPoint globalPosition = globalPointForEvent(event);471 WebEvent::Modifiers modifiers = modifiersForEvent(event);472 double timestamp = eventTimeStampSince1970(event);473 474 return WebGestureEvent(type, IntPoint(position), IntPoint(globalPosition), modifiers, timestamp);475 }476 #endif477 478 450 } // namespace WebKit 479 451 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
r156688 r157319 91 91 virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&); 92 92 93 #if ENABLE(GESTURE_EVENTS)94 virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);95 #endif96 93 virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled); 97 94 -
trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
r156860 r157319 371 371 } 372 372 373 #if ENABLE(GESTURE_EVENTS)374 void PageClientImpl::doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled)375 {376 notImplemented();377 }378 #endif379 380 373 void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) 381 374 { -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r157058 r157319 195 195 196 196 id _flagsChangedEventMonitor; 197 #if ENABLE(GESTURE_EVENTS) 198 id _endGestureMonitor; 199 #endif 200 197 201 198 #if ENABLE(FULLSCREEN_API) 202 199 RetainPtr<WKFullScreenWindowController> _fullScreenWindowController; … … 1215 1212 } 1216 1213 1217 #if ENABLE(GESTURE_EVENTS)1218 1219 static const short kIOHIDEventTypeScroll = 6;1220 1221 - (void)shortCircuitedEndGestureWithEvent:(NSEvent *)event1222 {1223 if ([event subtype] != kIOHIDEventTypeScroll)1224 return;1225 1226 WebGestureEvent webEvent = WebEventFactory::createWebGestureEvent(event, self);1227 _data->_page->handleGestureEvent(webEvent);1228 1229 if (_data->_endGestureMonitor) {1230 [NSEvent removeMonitor:_data->_endGestureMonitor];1231 _data->_endGestureMonitor = nil;1232 }1233 }1234 1235 - (void)beginGestureWithEvent:(NSEvent *)event1236 {1237 if ([event subtype] != kIOHIDEventTypeScroll)1238 return;1239 1240 WebGestureEvent webEvent = WebEventFactory::createWebGestureEvent(event, self);1241 _data->_page->handleGestureEvent(webEvent);1242 1243 if (!_data->_endGestureMonitor) {1244 _data->_endGestureMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskEndGesture handler:^(NSEvent *blockEvent) {1245 [self shortCircuitedEndGestureWithEvent:blockEvent];1246 return blockEvent;1247 }];1248 }1249 }1250 #endif1251 1252 1214 - (void)doCommandBySelector:(SEL)selector 1253 1215 { … … 2018 1980 _data->_flagsChangedEventMonitor = nil; 2019 1981 2020 #if ENABLE(GESTURE_EVENTS)2021 if (_data->_endGestureMonitor) {2022 [NSEvent removeMonitor:_data->_endGestureMonitor];2023 _data->_endGestureMonitor = nil;2024 }2025 #endif2026 1982 WKHideWordDefinitionWindow(); 2027 1983 } -
trunk/Source/WebKit2/UIProcess/PageClient.h
r156847 r157319 59 59 class NativeWebTouchEvent; 60 60 #endif 61 #if ENABLE(GESTURE_EVENTS)62 class WebGestureEvent;63 #endif64 61 class WebContextMenuProxy; 65 62 class WebEditCommandProxy; … … 171 168 172 169 virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0; 173 #if ENABLE(GESTURE_EVENTS)174 virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled) = 0;175 #endif176 170 #if ENABLE(TOUCH_EVENTS) 177 171 virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) = 0; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r157064 r157319 1401 1401 #endif // ENABLE(NETSCAPE_PLUGIN_API) 1402 1402 1403 #if ENABLE(GESTURE_EVENTS)1404 void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)1405 {1406 if (!isValid())1407 return;1408 1409 m_gestureEventQueue.append(event);1410 1411 m_process->responsivenessTimer()->start();1412 m_process->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);1413 }1414 #endif1415 1416 1403 #if ENABLE(TOUCH_EVENTS) 1417 1404 void WebPageProxy::handleTouchEvent(const NativeWebTouchEvent& event) … … 3462 3449 case WebEvent::RawKeyDown: 3463 3450 case WebEvent::Char: 3464 #if ENABLE(GESTURE_EVENTS)3465 case WebEvent::GestureScrollBegin:3466 case WebEvent::GestureScrollEnd:3467 case WebEvent::GestureSingleTap:3468 #endif3469 3451 #if ENABLE(TOUCH_EVENTS) 3470 3452 case WebEvent::TouchStart: … … 3489 3471 case WebEvent::MouseDown: 3490 3472 break; 3491 #if ENABLE(GESTURE_EVENTS)3492 case WebEvent::GestureScrollBegin:3493 case WebEvent::GestureScrollEnd:3494 case WebEvent::GestureSingleTap: {3495 WebGestureEvent event = m_gestureEventQueue.first();3496 MESSAGE_CHECK(type == event.type());3497 3498 m_gestureEventQueue.removeFirst();3499 m_pageClient->doneWithGestureEvent(event, handled);3500 break;3501 }3502 #endif3503 3473 case WebEvent::MouseUp: 3504 3474 m_currentlyProcessedMouseDownEvent = nullptr; … … 3833 3803 3834 3804 // Can't expect DidReceiveEvent notifications from a crashed web process. 3835 #if ENABLE(GESTURE_EVENTS)3836 m_gestureEventQueue.clear();3837 #endif3838 3805 m_keyEventQueue.clear(); 3839 3806 m_wheelEventQueue.clear(); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r157064 r157319 151 151 struct WebPopupItem; 152 152 153 #if ENABLE(GESTURE_EVENTS)154 class WebGestureEvent;155 #endif156 157 153 #if ENABLE(VIBRATION) 158 154 class WebVibrationProxy; … … 419 415 void handleWheelEvent(const NativeWebWheelEvent&); 420 416 void handleKeyboardEvent(const NativeWebKeyboardEvent&); 421 #if ENABLE(GESTURE_EVENTS)422 void handleGestureEvent(const WebGestureEvent&);423 #endif424 417 #if ENABLE(TOUCH_EVENTS) 425 418 void handleTouchEvent(const NativeWebTouchEvent&); … … 1168 1161 uint64_t m_syncNavigationActionPolicyDownloadID; 1169 1162 1170 #if ENABLE(GESTURE_EVENTS)1171 Deque<WebGestureEvent> m_gestureEventQueue;1172 #endif1173 1163 Deque<NativeWebKeyboardEvent> m_keyEventQueue; 1174 1164 Deque<NativeWebWheelEvent> m_wheelEventQueue; -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r157251 r157319 892 892 BC90A1D3122DD55E00CC8C50 /* WebURLResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90A1D1122DD55E00CC8C50 /* WebURLResponse.cpp */; }; 893 893 BC90A1D7122DD66A00CC8C50 /* WebURLResponseMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90A1D5122DD66A00CC8C50 /* WebURLResponseMac.mm */; }; 894 BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9585C712F095B800755821 /* WebGestureEvent.cpp */; };895 894 BC963D6B113DD19200574BE2 /* WebPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC963D6A113DD19200574BE2 /* WebPage.cpp */; }; 896 895 BC963D6E113DD1A500574BE2 /* WebPageMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC963D6D113DD1A500574BE2 /* WebPageMac.mm */; }; … … 2313 2312 BC90A1D1122DD55E00CC8C50 /* WebURLResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebURLResponse.cpp; sourceTree = "<group>"; }; 2314 2313 BC90A1D5122DD66A00CC8C50 /* WebURLResponseMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebURLResponseMac.mm; sourceTree = "<group>"; }; 2315 BC9585C712F095B800755821 /* WebGestureEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebGestureEvent.cpp; sourceTree = "<group>"; };2316 2314 BC963D6A113DD19200574BE2 /* WebPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPage.cpp; sourceTree = "<group>"; }; 2317 2315 BC963D6D113DD1A500574BE2 /* WebPageMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageMac.mm; sourceTree = "<group>"; }; … … 3162 3160 BC0E607112D6BC200012A72A /* WebGeolocationPosition.h */, 3163 3161 0F174AA2142A4CB60039250F /* WebGeometry.h */, 3164 BC9585C712F095B800755821 /* WebGestureEvent.cpp */,3165 3162 BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */, 3166 3163 BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */, … … 6429 6426 BC0E607412D6BC200012A72A /* WebGeolocationPosition.cpp in Sources */, 6430 6427 BC1BE1F312D54DBD0004A228 /* WebGeolocationProvider.cpp in Sources */, 6431 BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */,6432 6428 BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */, 6433 6429 BCF69F861176CD6F00471A52 /* WebHistoryClient.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
r156924 r157319 110 110 } 111 111 112 #if ENABLE(GESTURE_EVENTS)113 void EventDispatcher::gestureEvent(uint64_t pageID, const WebGestureEvent& gestureEvent)114 {115 RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchGestureEvent, this, pageID, gestureEvent));116 }117 #endif118 119 112 void EventDispatcher::dispatchWheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent) 120 113 { … … 128 121 } 129 122 130 #if ENABLE(GESTURE_EVENTS)131 void EventDispatcher::dispatchGestureEvent(uint64_t pageID, const WebGestureEvent& gestureEvent)132 {133 ASSERT(isMainThread());134 135 WebPage* webPage = WebProcess::shared().webPage(pageID);136 if (!webPage)137 return;138 139 webPage->gestureEvent(gestureEvent);140 }141 #endif142 143 123 #if ENABLE(THREADED_SCROLLING) 144 124 void EventDispatcher::sendDidReceiveEvent(uint64_t pageID, const WebEvent& event, bool didHandleEvent) -
trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
r156924 r157319 43 43 class WebWheelEvent; 44 44 45 #if ENABLE(GESTURE_EVENTS)46 class WebGestureEvent;47 #endif48 49 45 class EventDispatcher : public CoreIPC::Connection::WorkQueueMessageReceiver { 50 46 public: … … 67 63 // Message handlers 68 64 void wheelEvent(uint64_t pageID, const WebWheelEvent&, bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom); 69 #if ENABLE(GESTURE_EVENTS)70 void gestureEvent(uint64_t pageID, const WebGestureEvent&);71 #endif72 65 73 66 // This is called on the main thread. 74 67 void dispatchWheelEvent(uint64_t pageID, const WebWheelEvent&); 75 #if ENABLE(GESTURE_EVENTS)76 void dispatchGestureEvent(uint64_t pageID, const WebGestureEvent&);77 #endif78 68 79 69 #if ENABLE(THREADED_SCROLLING) -
trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.messages.in
r156924 r157319 23 23 messages -> EventDispatcher { 24 24 WheelEvent(uint64_t pageID, WebKit::WebWheelEvent event, bool canRubberBandsAtLeft, bool canRubberBandsAtRight, bool canRubberBandsAtTop, bool canRubberBandsAtBottom) 25 26 #if ENABLE(GESTURE_EVENTS)27 GestureEvent(uint64_t pageID, WebKit::WebGestureEvent event)28 #endif29 30 25 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r157058 r157319 1710 1710 } 1711 1711 1712 #if ENABLE(GESTURE_EVENTS)1713 static bool handleGestureEvent(const WebGestureEvent& gestureEvent, Page* page)1714 {1715 Frame& frame = page->mainFrame();1716 if (!frame.view())1717 return false;1718 1719 PlatformGestureEvent platformGestureEvent = platform(gestureEvent);1720 return frame.eventHandler().handleGestureEvent(platformGestureEvent);1721 }1722 1723 void WebPage::gestureEvent(const WebGestureEvent& gestureEvent)1724 {1725 bool handled = false;1726 1727 if (canHandleUserEvents()) {1728 CurrentEvent currentEvent(gestureEvent);1729 1730 handled = handleGestureEvent(gestureEvent, m_page.get());1731 }1732 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(gestureEvent.type()), handled));1733 }1734 #endif1735 1736 1712 WKTypeRef WebPage::pageOverlayCopyAccessibilityAttributeValue(WKStringRef attribute, WKTypeRef parameter) 1737 1713 { -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r156924 r157319 148 148 struct WebPreferencesStore; 149 149 150 #if ENABLE(GESTURE_EVENTS)151 class WebGestureEvent;152 #endif153 154 150 #if ENABLE(TOUCH_EVENTS) 155 151 class WebTouchEvent; … … 568 564 569 565 void wheelEvent(const WebWheelEvent&); 570 #if ENABLE(GESTURE_EVENTS)571 void gestureEvent(const WebGestureEvent&);572 #endif573 566 574 567 void numWheelEventHandlersChanged(unsigned);
Note: See TracChangeset
for help on using the changeset viewer.