Changeset 181660 in webkit
- Timestamp:
- Mar 17, 2015 1:20:48 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r181658 r181660 1 2015-03-17 Beth Dakin <bdakin@apple.com> 2 3 DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 4 10.10.2 5 https://bugs.webkit.org/show_bug.cgi?id=142700 6 -and corresponding- 7 rdar://problem/20165168 8 9 Reviewed by Tim Horton. 10 11 This patch adds a new enum and member variable so that EventHandler can keep track 12 of the current immediate action state. 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::EventHandler): 15 16 A new mouse press even is starting. We can re-set m_immediateActionStage to none 17 unless a Hit Test has already been performed. 18 (WebCore::EventHandler::handleMousePressEvent): 19 20 If an immediate action was completed, then send mouse to the DOM and return early. 21 This will prevent us from doing our own normal mouseup behaviors such as 22 navigating to a link that was clicked — we only want to do that if the click was 23 not used to perform an immediate action. 24 (WebCore::EventHandler::handleMouseReleaseEvent): 25 * page/EventHandler.h: 26 (WebCore::EventHandler::setImmediateActionStage): 27 1 28 2015-03-17 Joseph Pecoraro <pecoraro@apple.com> 2 29 -
trunk/Source/WebCore/page/EventHandler.cpp
r181484 r181660 424 424 , m_autoHideCursorTimer(*this, &EventHandler::autoHideCursorTimerFired) 425 425 #endif 426 , m_immediateActionStage(ImmediateActionStage::None) 426 427 { 427 428 } … … 764 765 765 766 m_mouseDown = event.event(); 767 768 if (m_immediateActionStage != ImmediateActionStage::PerformedHitTest) 769 m_immediateActionStage = ImmediateActionStage::None; 766 770 767 771 if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event)) … … 2058 2062 return !dispatchMouseEvent(eventNames().mouseupEvent, m_frameSetBeingResized.get(), true, m_clickCount, platformMouseEvent, false); 2059 2063 2064 // If an immediate action was completed using this series of mouse events, then we should send mouseup to 2065 // the DOM and return now so that we don't perform our own default behaviors. 2066 if (m_immediateActionStage == ImmediateActionStage::ActionCompleted) { 2067 m_immediateActionStage = ImmediateActionStage::None; 2068 return !dispatchMouseEvent(eventNames().mouseupEvent, m_lastElementUnderMouse.get(), true, m_clickCount, platformMouseEvent, false); 2069 } 2070 m_immediateActionStage = ImmediateActionStage::None; 2071 2060 2072 if (m_lastScrollbarUnderMouse) { 2061 2073 invalidateClick(); -
trunk/Source/WebCore/page/EventHandler.h
r181484 r181660 118 118 enum CheckDragHysteresis { ShouldCheckDragHysteresis, DontCheckDragHysteresis }; 119 119 120 enum class ImmediateActionStage { 121 None, 122 PerformedHitTest, 123 ActionCancelled, 124 ActionCompleted 125 }; 126 120 127 class EventHandler { 121 128 WTF_MAKE_NONCOPYABLE(EventHandler); … … 306 313 bool isHandlingWheelEvent() const { return m_isHandlingWheelEvent; } 307 314 315 WEBCORE_EXPORT void setImmediateActionStage(ImmediateActionStage stage) { m_immediateActionStage = stage; } 316 308 317 private: 309 318 #if ENABLE(DRAG_SUPPORT) … … 565 574 Timer m_autoHideCursorTimer; 566 575 #endif 576 577 ImmediateActionStage m_immediateActionStage; 567 578 }; 568 579 -
trunk/Source/WebKit2/ChangeLog
r181656 r181660 1 2015-03-17 Beth Dakin <bdakin@apple.com> 2 3 DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 4 10.10.2 5 https://bugs.webkit.org/show_bug.cgi?id=142700 6 -and corresponding- 7 rdar://problem/20165168 8 9 Reviewed by Tim Horton. 10 11 No need to tell the WKImmediateActionController about mouse down any more since we 12 are expecting it at the beginning of an immediate action interaction. 13 * UIProcess/API/mac/WKView.mm: 14 (-[WKView mouseDown:]): 15 16 Set the delaysPrimaryMouseButtonEvents to NO for the 17 _immediateActionGestureRecognizer. This will cause AppKit to send up the mouse 18 events at the expected time. 19 (-[WKView initWithFrame:processPool:configuration:webView:]): 20 21 WebCore::EventHandler now needs to know if an immediate action cancelled or 22 completed. This plumbs that information down. 23 * UIProcess/WebPageProxy.cpp: 24 (WebKit::WebPageProxy::immediateActionDidCancel): 25 (WebKit::WebPageProxy::immediateActionDidComplete): 26 * UIProcess/WebPageProxy.h: 27 * UIProcess/mac/WKImmediateActionController.h: 28 * UIProcess/mac/WKImmediateActionController.mm: 29 (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]): 30 (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]): 31 (-[WKImmediateActionController wkView:willHandleMouseDown:]): Deleted. 32 * WebProcess/WebPage/WebPage.h: 33 * WebProcess/WebPage/WebPage.messages.in: 34 35 Call EventHandler::setImmediateActionStage() with the appropriate stage. 36 * WebProcess/WebPage/mac/WebPageMac.mm: 37 (WebKit::WebPage::performActionMenuHitTestAtLocation): 38 (WebKit::WebPage::immediateActionDidCancel): 39 (WebKit::WebPage::immediateActionDidComplete): 40 1 41 2015-03-17 Timothy Horton <timothy_horton@apple.com> 2 42 -
trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm
r181176 r181660 1275 1275 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 1276 1276 [_data->_actionMenuController wkView:self willHandleMouseDown:event]; 1277 [_data->_immediateActionController wkView:self willHandleMouseDown:event];1278 1277 #endif 1279 1278 [self mouseDownInternal:event]; … … 3667 3666 _data->_immediateActionController = adoptNS([[WKImmediateActionController alloc] initWithPage:*_data->_page view:self recognizer:_data->_immediateActionGestureRecognizer.get()]); 3668 3667 [_data->_immediateActionGestureRecognizer setDelegate:_data->_immediateActionController.get()]; 3668 [_data->_immediateActionGestureRecognizer setDelaysPrimaryMouseButtonEvents:NO]; 3669 3669 } 3670 3670 #endif -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r181423 r181660 5566 5566 } 5567 5567 5568 void WebPageProxy::immediateActionDidCancel() 5569 { 5570 m_process->send(Messages::WebPage::ImmediateActionDidCancel(), m_pageID); 5571 } 5572 5573 void WebPageProxy::immediateActionDidComplete() 5574 { 5575 m_process->send(Messages::WebPage::ImmediateActionDidComplete(), m_pageID); 5576 } 5577 5568 5578 void WebPageProxy::didPerformActionMenuHitTest(const ActionMenuHitTestResult& result, bool forImmediateAction, const UserData& userData) 5569 5579 { -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r181423 r181660 986 986 void focusAndSelectLastActionMenuHitTestResult(); 987 987 988 void immediateActionDidCancel(); 989 void immediateActionDidComplete(); 990 988 991 void installViewStateChangeCompletionHandler(void(^completionHandler)()); 989 992 #endif -
trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.h
r181176 r181660 70 70 - (void)willDestroyView:(WKView *)view; 71 71 - (void)didPerformActionMenuHitTest:(const WebKit::ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData; 72 - (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event;73 72 - (void)dismissContentRelativeChildWindows; 74 73 - (BOOL)hasActiveImmediateAction; -
trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
r181176 r181660 89 89 } 90 90 91 - (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event92 {93 [self _clearImmediateActionState];94 }95 96 91 - (void)_cancelImmediateAction 97 92 { … … 219 214 return; 220 215 216 _page->immediateActionDidCancel(); 217 221 218 [_wkView _cancelImmediateActionAnimation]; 222 219 … … 230 227 if (immediateActionRecognizer != _immediateActionRecognizer) 231 228 return; 229 230 _page->immediateActionDidComplete(); 232 231 233 232 [_wkView _completeImmediateActionAnimation]; -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r181442 r181660 1085 1085 void selectLastActionMenuRange(); 1086 1086 void focusAndSelectLastActionMenuHitTestResult(); 1087 void immediateActionDidCancel(); 1088 void immediateActionDidComplete(); 1087 1089 void setFont(const String& fontFamily, double fontSize, uint64_t fontTraits); 1088 1090 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r181442 r181660 406 406 SelectLastActionMenuRange() 407 407 FocusAndSelectLastActionMenuHitTestResult() 408 ImmediateActionDidCancel() 409 ImmediateActionDidComplete() 408 410 DataDetectorsDidPresentUI(WebCore::PageOverlay::PageOverlayID pageOverlay) 409 411 DataDetectorsDidChangeUI(WebCore::PageOverlay::PageOverlayID pageOverlay) -
trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
r181442 r181660 1025 1025 HitTestResult hitTestResult = mainFrame.eventHandler().hitTestResultAtPoint(locationInContentCoordinates); 1026 1026 1027 if (forImmediateAction) 1028 mainFrame.eventHandler().setImmediateActionStage(ImmediateActionStage::PerformedHitTest); 1029 1027 1030 ActionMenuHitTestResult actionMenuResult; 1028 1031 actionMenuResult.hitTestLocationInViewCooordinates = locationInViewCooordinates; … … 1146 1149 } 1147 1150 1151 void WebPage::immediateActionDidCancel() 1152 { 1153 m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled); 1154 } 1155 1156 void WebPage::immediateActionDidComplete() 1157 { 1158 m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCompleted); 1159 } 1160 1148 1161 void WebPage::dataDetectorsDidPresentUI(PageOverlay::PageOverlayID overlayID) 1149 1162 {
Note: See TracChangeset
for help on using the changeset viewer.