Changeset 255322 in webkit
- Timestamp:
- Jan 28, 2020 4:23:03 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r255318 r255322 1 2020-01-28 Tim Horton <timothy_horton@apple.com> 2 3 macCatalyst: Triple clicking to select a sentence results in an empty selection 4 https://bugs.webkit.org/show_bug.cgi?id=206863 5 <rdar://problem/58776993> 6 7 Reviewed by Wenson Hsieh. 8 9 * editing/EditingBehavior.h: 10 (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick const): 11 * page/ChromeClient.h: 12 (WebCore::ChromeClient::shouldUseMouseEventsForSelection): 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::canMouseDownStartSelect): 15 (WebCore::canMouseDownStartSelect): Deleted. 16 * page/EventHandler.h: 17 Disable WebCore's mouse-event-driven selection mechanisms on macCatalyst, 18 where we use a UITextInteraction-driven selection instead. Otherwise, 19 they conflict with each other in a chaotic fashion. 20 1 21 2020-01-28 Sihui Liu <sihui_liu@apple.com> 2 22 -
trunk/Source/WebCore/editing/EditingBehavior.h
r243124 r255322 61 61 62 62 // On Mac, when processing a contextual click, the object being clicked upon should be selected. 63 bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior || m_type == EditingIOSBehavior; }63 bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior; } 64 64 65 65 // On Linux, should be able to get and insert spelling suggestions without selecting the misspelled word. -
trunk/Source/WebCore/page/ChromeClient.h
r253636 r255322 194 194 virtual bool supportsSettingCursor() { return true; } 195 195 196 virtual bool shouldUseMouseEventsForSelection() { return true; } 197 196 198 virtual FloatSize screenSize() const { return const_cast<ChromeClient&>(*this).windowRect().size(); } 197 199 virtual FloatSize availableScreenSize() const { return const_cast<ChromeClient&>(*this).windowRect().size(); } -
trunk/Source/WebCore/page/EventHandler.cpp
r255128 r255322 732 732 } 733 733 734 static inline bool canMouseDownStartSelect(Node* node) 735 { 734 bool EventHandler::canMouseDownStartSelect(Node* node) 735 { 736 if (Page* page = m_frame.page()) { 737 if (!page->chrome().client().shouldUseMouseEventsForSelection()) 738 return false; 739 } 740 736 741 if (!node || !node->renderer()) 737 742 return true; -
trunk/Source/WebCore/page/EventHandler.h
r255128 r255322 501 501 bool shouldSendMouseEventsToInactiveWindows() const; 502 502 503 bool canMouseDownStartSelect(Node*); 504 503 505 Frame& m_frame; 504 506 -
trunk/Source/WebKit/ChangeLog
r255313 r255322 1 2020-01-28 Tim Horton <timothy_horton@apple.com> 2 3 macCatalyst: Triple clicking to select a sentence results in an empty selection 4 https://bugs.webkit.org/show_bug.cgi?id=206863 5 <rdar://problem/58776993> 6 7 Reviewed by Wenson Hsieh. 8 9 * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: 10 * UIProcess/API/Cocoa/WKWebViewTesting.mm: 11 (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): 12 * UIProcess/API/mac/WKWebViewPrivateForTestingMac.h: 13 * UIProcess/API/mac/WKWebViewTestingMac.mm: 14 (-[WKWebView _doAfterProcessingAllPendingMouseEvents:]): Deleted. 15 * UIProcess/Cocoa/WebViewImpl.h: 16 * UIProcess/Cocoa/WebViewImpl.mm: 17 (WebKit::WebViewImpl::handleProcessSwapOrExit): 18 (WebKit::WebViewImpl::doAfterProcessingAllPendingMouseEvents): Deleted. 19 (WebKit::WebViewImpl::didFinishProcessingAllPendingMouseEvents): Deleted. 20 (WebKit::WebViewImpl::flushPendingMouseEventCallbacks): Deleted. 21 * UIProcess/PageClient.h: 22 * UIProcess/WebPageProxy.cpp: 23 (WebKit::WebPageProxy::doAfterProcessingAllPendingMouseEvents): 24 (WebKit::WebPageProxy::didFinishProcessingAllPendingMouseEvents): 25 (WebKit::WebPageProxy::flushPendingMouseEventCallbacks): 26 * UIProcess/WebPageProxy.h: 27 * UIProcess/ios/PageClientImplIOS.h: 28 * UIProcess/mac/PageClientImplMac.h: 29 * UIProcess/mac/PageClientImplMac.mm: 30 (WebKit::PageClientImpl::didFinishProcessingAllPendingMouseEvents): Deleted. 31 Move "doAfterProcessingAllPendingMouseEvents" to WebPage instead of WebViewImpl, 32 so it can be used on all platforms. Expose it via WKWebView. 33 34 * WebProcess/WebCoreSupport/WebChromeClient.h: 35 * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm: 36 (WebKit::WebChromeClient::shouldUseMouseEventsForSelection): 37 1 38 2020-01-28 Andres Gonzalez <andresg_22@apple.com> 2 39 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h
r255271 r255322 60 60 - (void)_setAssertionStateForTesting:(int)state; 61 61 62 - (void)_doAfterProcessingAllPendingMouseEvents:(dispatch_block_t)action; 63 62 64 + (void)_setApplicationBundleIdentifier:(NSString *)bundleIdentifier; 63 65 + (void)_clearApplicationBundleIdentifierTestingOverride; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm
r255271 r255322 204 204 } 205 205 206 - (void)_doAfterProcessingAllPendingMouseEvents:(dispatch_block_t)action 207 { 208 _page->doAfterProcessingAllPendingMouseEvents([action = makeBlockPtr(action)] { 209 action(); 210 }); 211 } 212 206 213 + (void)_setApplicationBundleIdentifier:(NSString *)bundleIdentifier 207 214 { -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r250645 r255322 157 157 void isPlayingAudioDidChange() final { } 158 158 159 void didFinishProcessingAllPendingMouseEvents() final { }160 161 159 void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 162 160 -
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewPrivateForTestingMac.h
r253465 r255322 51 51 - (void)_setHeaderBannerHeight:(int)height; 52 52 - (void)_setFooterBannerHeight:(int)height; 53 - (void)_doAfterProcessingAllPendingMouseEvents:(dispatch_block_t)action;54 53 55 54 @end -
trunk/Source/WebKit/UIProcess/API/mac/WKWebViewTestingMac.mm
r253527 r255322 102 102 } 103 103 104 - (void)_doAfterProcessingAllPendingMouseEvents:(dispatch_block_t)action105 {106 _impl->doAfterProcessingAllPendingMouseEvents(action);107 }108 109 104 - (NSMenu *)_activeMenu 110 105 { -
trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
r254121 r255322 159 159 #endif 160 160 161 void didFinishProcessingAllPendingMouseEvents() final { }162 163 161 IPC::Attachment hostFileDescriptor() final; 164 162 void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h
r254213 r255322 570 570 void handleAcceptedCandidate(NSTextCheckingResult *acceptedCandidate); 571 571 572 void doAfterProcessingAllPendingMouseEvents(dispatch_block_t action);573 void didFinishProcessingAllPendingMouseEvents();574 575 572 #if HAVE(TOUCH_BAR) 576 573 NSTouchBar *makeTouchBar(); … … 796 793 RetainPtr<NSEvent> m_keyDownEventBeingResent; 797 794 Vector<WebCore::KeypressCommand>* m_collectedKeypressCommands { nullptr }; 798 Vector<BlockPtr<void()>> m_callbackHandlersAfterProcessingPendingMouseEvents;799 795 800 796 String m_lastStringForCandidateRequest; -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r254312 r255322 1463 1463 1464 1464 updateRemoteAccessibilityRegistration(false); 1465 flushPendingMouseEventCallbacks();1466 1465 1467 1466 handleDOMPasteRequestWithResult(WebCore::DOMPasteAccessResponse::DeniedForGesture); … … 3401 3400 } 3402 3401 3403 void WebViewImpl::doAfterProcessingAllPendingMouseEvents(dispatch_block_t action)3404 {3405 if (!m_page->isProcessingMouseEvents()) {3406 action();3407 return;3408 }3409 3410 m_callbackHandlersAfterProcessingPendingMouseEvents.append(makeBlockPtr(action));3411 }3412 3413 void WebViewImpl::didFinishProcessingAllPendingMouseEvents()3414 {3415 flushPendingMouseEventCallbacks();3416 }3417 3418 void WebViewImpl::flushPendingMouseEventCallbacks()3419 {3420 for (auto& callback : m_callbackHandlersAfterProcessingPendingMouseEvents)3421 callback();3422 3423 m_callbackHandlersAfterProcessingPendingMouseEvents.clear();3424 }3425 3426 3402 void WebViewImpl::preferencesDidChange() 3427 3403 { -
trunk/Source/WebKit/UIProcess/PageClient.h
r253749 r255322 460 460 #endif 461 461 462 virtual void didFinishProcessingAllPendingMouseEvents() = 0;463 464 462 virtual void videoControlsManagerDidChange() { } 465 463 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r255135 r255322 2490 2490 } 2491 2491 2492 void WebPageProxy::doAfterProcessingAllPendingMouseEvents(WTF::Function<void ()>&& action) 2493 { 2494 if (!isProcessingMouseEvents()) { 2495 action(); 2496 return; 2497 } 2498 2499 m_callbackHandlersAfterProcessingPendingMouseEvents.append(WTFMove(action)); 2500 } 2501 2502 void WebPageProxy::didFinishProcessingAllPendingMouseEvents() 2503 { 2504 flushPendingMouseEventCallbacks(); 2505 } 2506 2507 void WebPageProxy::flushPendingMouseEventCallbacks() 2508 { 2509 for (auto& callback : m_callbackHandlersAfterProcessingPendingMouseEvents) 2510 callback(); 2511 2512 m_callbackHandlersAfterProcessingPendingMouseEvents.clear(); 2513 } 2514 2492 2515 #if MERGE_WHEEL_EVENTS 2493 2516 static bool canCoalesce(const WebWheelEvent& a, const WebWheelEvent& b) … … 6682 6705 if (auto* automationSession = process().processPool().automationSession()) 6683 6706 automationSession->mouseEventsFlushedForPage(*this); 6684 pageClient().didFinishProcessingAllPendingMouseEvents();6707 didFinishProcessingAllPendingMouseEvents(); 6685 6708 } 6686 6709 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r255135 r255322 890 890 void handleMouseEvent(const NativeWebMouseEvent&); 891 891 892 void doAfterProcessingAllPendingMouseEvents(WTF::Function<void ()>&&); 893 void didFinishProcessingAllPendingMouseEvents(); 894 void flushPendingMouseEventCallbacks(); 895 892 896 void handleWheelEvent(const NativeWebWheelEvent&); 893 897 … … 2439 2443 Deque<NativeWebGestureEvent> m_gestureEventQueue; 2440 2444 #endif 2445 Vector<WTF::Function<void ()>> m_callbackHandlersAfterProcessingPendingMouseEvents; 2441 2446 2442 2447 #if ENABLE(TOUCH_EVENTS) -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r254025 r255322 249 249 void handleAutocorrectionContext(const WebAutocorrectionContext&) final; 250 250 251 void didFinishProcessingAllPendingMouseEvents() final { }252 253 251 #if HAVE(PENCILKIT) 254 252 RetainPtr<WKDrawingView> createDrawingView(WebCore::GraphicsLayer::EmbeddedViewID) override; -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h
r250973 r255322 251 251 _WKRemoteObjectRegistry *remoteObjectRegistry() override; 252 252 253 void didFinishProcessingAllPendingMouseEvents() final;254 255 253 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 256 254 WebCore::WebMediaSessionManager& mediaSessionManager() override; -
trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm
r253465 r255322 920 920 } 921 921 922 void PageClientImpl::didFinishProcessingAllPendingMouseEvents()923 {924 m_impl->didFinishProcessingAllPendingMouseEvents();925 }926 927 922 void PageClientImpl::didRestoreScrollPosition() 928 923 { -
trunk/Source/WebKit/UIProcess/win/PageClientImpl.h
r243847 r255322 147 147 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; } 148 148 149 void didFinishProcessingAllPendingMouseEvents() final { }150 151 149 void requestDOMPasteAccess(const WebCore::IntRect&, const String&, CompletionHandler<void(WebCore::DOMPasteAccessResponse)>&&) final; 152 150 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
r253636 r255322 182 182 void didCreateEditableImage(WebCore::GraphicsLayer::EmbeddedViewID) final; 183 183 void didDestroyEditableImage(WebCore::GraphicsLayer::EmbeddedViewID) final; 184 185 bool shouldUseMouseEventsForSelection() final; 184 186 #endif 185 187 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm
r247926 r255322 182 182 } 183 183 184 bool WebChromeClient::shouldUseMouseEventsForSelection() 185 { 186 // In macCatalyst, despite getting mouse events, we still want UITextInteraction and friends to own selection gestures. 187 #if HAVE(HOVER_GESTURE_RECOGNIZER) 188 return false; 189 #else 190 return true; 191 #endif 192 } 193 184 194 } // namespace WebKit 185 195 -
trunk/Tools/ChangeLog
r255320 r255322 1 2020-01-28 Tim Horton <timothy_horton@apple.com> 2 3 macCatalyst: Triple clicking to select a sentence results in an empty selection 4 https://bugs.webkit.org/show_bug.cgi?id=206863 5 <rdar://problem/58776993> 6 7 Reviewed by Wenson Hsieh. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKitCocoa/MacCatalystMouseSupport.mm: Added. 11 (-[WKTestingEvent locationInView:]): 12 (-[WKTestingEvent _setButtonMask:]): 13 (-[WKTestingEvent _buttonMask]): 14 (-[WKTestingTouch locationInView:]): 15 (-[WKTestingTouch setTapCount:]): 16 (-[WKTestingTouch tapCount]): 17 (mouseGesture): 18 (TEST): 19 Add a test ensuring that simply plumbing mouse events to WebCore 20 does not result in a selection change in macCatalyst (because UIKit 21 will handle the selection change itself, instead). 22 1 23 2020-01-28 Jonathan Bedard <jbedard@apple.com> 2 24 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r255318 r255322 128 128 2D01D06E23218FEE0039AA3A /* WKWebViewPrintFormatter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D01D06D23218FEE0039AA3A /* WKWebViewPrintFormatter.mm */; }; 129 129 2D08E9372267D0F4002518DA /* ReparentWebViewTimeout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D08E9362267D0F3002518DA /* ReparentWebViewTimeout.mm */; }; 130 2D116E1323E0CB3A00208900 /* MacCatalystMouseSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D116E1223E0CB3900208900 /* MacCatalystMouseSupport.mm */; }; 130 131 2D1646E21D1862CD00015A1A /* DeferredViewInWindowStateChange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D1646E11D1862CD00015A1A /* DeferredViewInWindowStateChange.mm */; }; 131 132 2D2BEB2D22324E5F005544CA /* RequestTextInputContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D2BEB2C22324E5F005544CA /* RequestTextInputContext.mm */; }; … … 1655 1656 2D01D06D23218FEE0039AA3A /* WKWebViewPrintFormatter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewPrintFormatter.mm; sourceTree = "<group>"; }; 1656 1657 2D08E9362267D0F3002518DA /* ReparentWebViewTimeout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReparentWebViewTimeout.mm; sourceTree = "<group>"; }; 1658 2D116E1223E0CB3900208900 /* MacCatalystMouseSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MacCatalystMouseSupport.mm; sourceTree = "<group>"; }; 1657 1659 2D1646E11D1862CD00015A1A /* DeferredViewInWindowStateChange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DeferredViewInWindowStateChange.mm; path = WebKit/DeferredViewInWindowStateChange.mm; sourceTree = "<group>"; }; 1658 1660 2D1C04A51D76298B000A6816 /* TestNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestNavigationDelegate.h; path = cocoa/TestNavigationDelegate.h; sourceTree = "<group>"; }; … … 2970 2972 8C10AF96206467770018FD90 /* LocalStoragePersistence.mm */, 2971 2973 7A6A2C6F1DCCF87B00C0D085 /* LocalStorageQuirkTest.mm */, 2974 2D116E1223E0CB3900208900 /* MacCatalystMouseSupport.mm */, 2972 2975 07CC7DFD2266330800E39181 /* MediaBufferingPolicy.mm */, 2973 2976 51BE9E652376089500B4E117 /* MediaType.mm */, … … 4813 4816 6BF4A683239ED4CD00E2F45B /* LoggedInStatus.cpp in Sources */, 4814 4817 076E507F1F4513D6006E9F5A /* Logging.cpp in Sources */, 4818 2D116E1323E0CB3A00208900 /* MacCatalystMouseSupport.mm in Sources */, 4815 4819 CE1866491F72E8F100A0CAB6 /* MarkedText.cpp in Sources */, 4816 4820 07CC7DFE2266330900E39181 /* MediaBufferingPolicy.mm in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.