Changeset 248338 in webkit
- Timestamp:
- Aug 6, 2019 8:15:19 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 2 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248327 r248338 1 2019-08-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker notes 4 https://bugs.webkit.org/show_bug.cgi?id=200216 5 6 Reviewed by Wenson Hsieh. 7 8 Added a new regression test and removed the one added for r243044. 9 10 * fast/events/touch/ios/show-keyboard-after-preventing-touchstart-expected.txt: Removed. 11 * fast/events/touch/ios/show-keyboard-after-preventing-touchstart.html: Removed. 12 * fast/forms/ios/inputmode-change-update-keyboard-after-pointerup-expected.txt: Added. 13 * fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html: Added. 14 * fast/forms/ios/inputmode-change-update-keyboard.html: Fixed the test for manual testing. 15 1 16 2019-08-06 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/LayoutTests/fast/forms/ios/inputmode-change-update-keyboard.html
r244397 r248338 31 31 32 32 async function runTest() { 33 await UIHelper.setHardwareKeyboardAttached(false); 33 if (window.testRunner) 34 await UIHelper.setHardwareKeyboardAttached(false); 34 35 35 36 debug('inputmode="text"'); -
trunk/Source/WebKit/ChangeLog
r248336 r248338 1 2019-08-06 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iPadOS] slides.google.com: tapping near cursor in a slide title focuses the speaker notes 4 https://bugs.webkit.org/show_bug.cgi?id=200216 5 6 Reviewed by Wenson Hsieh. 7 8 The bug was caused by a race condition between Google slides removing inputmode="none" from the hidden 9 content editable and updating the focused region upon receiving a pointerup event, which happens after 10 the Google slides had already updated its page layout & coordinates based on new visual viewport with 11 the software keyboard's boudning rect taken into account. 12 13 Delay bringing up the software keyboard for a inputmode change until all touches are released. 14 15 In the future, we could consider also delaying the software keyboard to be brought in general until 16 touchend / pointerup events are dispatched but this is rather risky since that could affact random 17 other websites while Google suites is the only major site to make use of inputmode="none". 18 19 This patch also reverts r243044, which was added for Google slides, since it's no longer needed and 20 interferes with this patch by adding another way to bring up the software keyboard. 21 22 Note: Adjusting touchend / pointerup coordinates while the keyboard is being brought up doesn't work 23 because the page had already updated the layout by then based on new visual viewport size. 24 25 Test: fast/forms/ios/inputmode-change-update-keyboard-after-pointerup.html 26 27 * UIProcess/WebPageProxy.cpp: 28 (WebKit::WebPageProxy::handleTouchEventSynchronously): Call didReleaseAllTouchPoints when all 29 touches are released. 30 (WebKit::WebPageProxy::handleTouchEventAsynchronously): Ditto. 31 (WebKit::WebPageProxy::handleTouchEvent): Ditto. 32 * UIProcess/WebPageProxy.h: 33 (WebKit::WebPageProxy::didReleaseAllTouchPoints): Added for non-iOS platforms. 34 (WebKit::WebPageProxy::m_pendingInputModeChange): Added. Used when inputmode is changed while 35 there is an on-going touch interaction. 36 * UIProcess/ios/WebPageProxyIOS.mm: 37 (WebKit::WebPageProxy::elementDidFocus): Clear m_pendingInputModeChange when a new element is focused. 38 (WebKit::WebPageProxy::elementDidBlur): Ditto for bluring. 39 (WebKit::WebPageProxy::focusedElementDidChangeInputMode): Don't bring up the software keyboard now if 40 there are on-going touches by exiting early after setting m_pendingInputModeChange. 41 (WebKit::WebPageProxy::didReleaseAllTouchPoints): Bring up the software keyboard if inputmode 42 had changed from "none" to something else. 43 * WebProcess/WebPage/WebPage.cpp: 44 (WebKit::WebPage::dispatchTouchEvent): Removed the code added by r243044. 45 1 46 2019-08-06 Fujii Hironori <Hironori.Fujii@sony.com> 2 47 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r248336 r248338 2689 2689 m_process->responsivenessTimer().stop(); 2690 2690 2691 if (event.allTouchPointsAreReleased()) 2691 if (event.allTouchPointsAreReleased()) { 2692 2692 m_touchAndPointerEventTracking.reset(); 2693 didReleaseAllTouchPoints(); 2694 } 2693 2695 } 2694 2696 … … 2712 2714 m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0); 2713 2715 2714 if (event.allTouchPointsAreReleased()) 2716 if (event.allTouchPointsAreReleased()) { 2715 2717 m_touchAndPointerEventTracking.reset(); 2718 didReleaseAllTouchPoints(); 2719 } 2716 2720 } 2717 2721 … … 2746 2750 } 2747 2751 2748 if (event.allTouchPointsAreReleased()) 2752 if (event.allTouchPointsAreReleased()) { 2749 2753 m_touchAndPointerEventTracking.reset(); 2754 didReleaseAllTouchPoints(); 2755 } 2750 2756 } 2751 2757 #endif // ENABLE(TOUCH_EVENTS) -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r248029 r248338 1947 1947 void elementDidBlur(); 1948 1948 void focusedElementDidChangeInputMode(WebCore::InputMode); 1949 void didReleaseAllTouchPoints(); 1949 1950 void didReceiveEditorStateUpdateAfterFocus(); 1950 1951 … … 1955 1956 void disableInspectorNodeSearch(); 1956 1957 void focusedElementInformationCallback(const FocusedElementInformation&, CallbackID); 1958 #else 1959 void didReleaseAllTouchPoints() { } 1957 1960 #endif // PLATFORM(IOS_FAMILY) 1958 1961 … … 2175 2178 2176 2179 #if PLATFORM(IOS_FAMILY) 2180 Optional<WebCore::InputMode> m_pendingInputModeChange; 2177 2181 Optional<WebCore::ViewportArguments> m_overrideViewportArguments; 2178 2182 VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate; -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r248129 r248338 906 906 void WebPageProxy::elementDidFocus(const FocusedElementInformation& information, bool userIsInteracting, bool blurPreviousNode, OptionSet<WebCore::ActivityState::Flag> activityStateChanges, const UserData& userData) 907 907 { 908 m_pendingInputModeChange = WTF::nullopt; 908 909 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = true; 909 910 … … 920 921 void WebPageProxy::elementDidBlur() 921 922 { 923 m_pendingInputModeChange = WTF::nullopt; 922 924 m_waitingForPostLayoutEditorStateUpdateAfterFocusingElement = false; 923 925 m_deferredElementDidFocusArguments = nullptr; … … 927 929 void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode) 928 930 { 931 #if ENABLE(TOUCH_EVENTS) 932 if (m_touchAndPointerEventTracking.isTrackingAnything()) { 933 m_pendingInputModeChange = mode; 934 return; 935 } 936 #endif 937 929 938 pageClient().focusedElementDidChangeInputMode(mode); 939 } 940 941 void WebPageProxy::didReleaseAllTouchPoints() 942 { 943 if (!m_pendingInputModeChange) 944 return; 945 946 pageClient().focusedElementDidChangeInputMode(*m_pendingInputModeChange); 947 m_pendingInputModeChange = WTF::nullopt; 930 948 } 931 949 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r248203 r248338 2898 2898 { 2899 2899 SetForScope<bool> userIsInteractingChange { m_userIsInteracting, true }; 2900 2901 auto oldFocusedFrame = makeRefPtr(m_page->focusController().focusedFrame());2902 auto oldFocusedElement = makeRefPtr(oldFocusedFrame ? oldFocusedFrame->document()->focusedElement() : nullptr);2903 2904 2900 m_lastInteractionLocation = touchEvent.position(); 2905 2901 CurrentEvent currentEvent(touchEvent); 2906 2902 handled = handleTouchEvent(touchEvent, m_page.get()); 2907 2903 updatePotentialTapSecurityOrigin(touchEvent, handled); 2908 2909 if (handled && oldFocusedElement) {2910 auto newFocusedFrame = makeRefPtr(m_page->focusController().focusedFrame());2911 auto newFocusedElement = makeRefPtr(newFocusedFrame ? newFocusedFrame->document()->focusedElement() : nullptr);2912 if (oldFocusedElement == newFocusedElement && isTransparentOrFullyClipped(*newFocusedElement))2913 elementDidRefocus(*newFocusedElement);2914 }2915 2904 } 2916 2905
Note: See TracChangeset
for help on using the changeset viewer.