WebKit Bugzilla
Attachment 361064 Details for
Bug 193683
: [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193683-20190204094355.patch (text/plain), 8.59 KB, created by
Per Arne Vollan
on 2019-02-04 09:43:56 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2019-02-04 09:43:56 PST
Size:
8.59 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 240927) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2019-02-01 Per Arne Vollan <pvollan@apple.com> >+ >+ [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process. >+ https://bugs.webkit.org/show_bug.cgi?id=193683 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a keyboard is attached/deattached or the application becomes foreground, send a message from >+ the UI process to the WebContent process, notifying whether a keyboard is attached or not. Also, >+ cache the value of [UIKeyboard isInHardwareKeyboardMode] in the UI process, since this call seems >+ to be expensive. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (hardwareKeyboardAvailabilityChangedCallback): >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): >+ * UIProcess/ios/WebPageProxyIOS.mm: >+ (WebKit::WebPageProxy::applicationWillEnterForeground): >+ (WebKit::WebPageProxy::hardwareKeyboardAvailabilityChanged): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::platformEditorState const): >+ (WebKit::WebPage::hardwareKeyboardAvailabilityChanged): >+ > 2019-02-04 Antoine Quint <graouts@apple.com> > > Use a dedicated type instead of int32_t for pointer identifiers >Index: Source/WebKit/UIProcess/WebPageProxy.h >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.h (revision 240927) >+++ Source/WebKit/UIProcess/WebPageProxy.h (working copy) >@@ -678,7 +678,7 @@ public: > void storeSelectionForAccessibility(bool); > void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow); > void cancelAutoscroll(); >- void hardwareKeyboardAvailabilityChanged(); >+ void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached); > bool isScrollingOrZooming() const { return m_isScrollingOrZooming; } > #if ENABLE(DATA_INTERACTION) > void didHandleDragStartRequest(bool started); >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 240927) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -3275,11 +3275,16 @@ - (void)_keyboardWillHide:(NSNotificatio > [self _keyboardChangedWithInfo:notification.userInfo adjustScrollView:YES]; > } > >+namespace WebKit { >+extern bool& keyboardIsAttached(); >+} >+ > static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef) > { > ASSERT(observer); > WKWebView *webView = (__bridge WKWebView *)observer; >- webView._page->hardwareKeyboardAvailabilityChanged(); >+ keyboardIsAttached() = [UIKeyboard isInHardwareKeyboardMode]; >+ webView._page->hardwareKeyboardAvailabilityChanged(keyboardIsAttached()); > } > > - (void)_windowDidRotate:(NSNotification *)notification >Index: Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >=================================================================== >--- Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (revision 240927) >+++ Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (working copy) >@@ -4611,6 +4611,10 @@ static bool isAssistableInputType(WebKit > > static const double minimumFocusedElementAreaForSuppressingSelectionAssistant = 4; > >+namespace WebKit { >+extern bool& keyboardIsAttached(); >+} >+ > - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject > { > SetForScope<BOOL> isChangingFocusForScope { _isChangingFocus, hasFocusedElement(_focusedElementInformation) }; >@@ -4654,7 +4658,7 @@ - (void)_elementDidFocus:(const WebKit:: > || (_isChangingFocus && ![_focusedFormControlView isHidden]) > #else > || _isChangingFocus >- || [UIKeyboard isInHardwareKeyboardMode] >+ || keyboardIsAttached() > #endif > #if ENABLE(DRAG_SUPPORT) > || _dragDropInteractionState.isPerformingDrop() >Index: Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >=================================================================== >--- Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (revision 240927) >+++ Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (working copy) >@@ -65,6 +65,12 @@ > namespace WebKit { > using namespace WebCore; > >+bool& keyboardIsAttached() >+{ >+ static bool keyboardAttached = false; >+ return keyboardAttached; >+} >+ > void WebPageProxy::platformInitialize() > { > } >@@ -672,6 +678,8 @@ void WebPageProxy::applicationWillEnterF > { > bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock]; > m_process->send(Messages::WebPage::ApplicationWillEnterForeground(isSuspendedUnderLock), m_pageID); >+ keyboardIsAttached() = [UIKeyboard isInHardwareKeyboardMode]; >+ m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(keyboardIsAttached()), m_pageID); > } > > void WebPageProxy::applicationWillResignActive() >@@ -1109,10 +1117,10 @@ void WebPageProxy::setIsScrollingOrZoomi > m_validationBubble->show(); > } > >-void WebPageProxy::hardwareKeyboardAvailabilityChanged() >+void WebPageProxy::hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached) > { > updateCurrentModifierState(); >- m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(), m_pageID); >+ m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(keyboardIsAttached), m_pageID); > } > > #if ENABLE(DATA_INTERACTION) >Index: Source/WebKit/WebProcess/WebPage/WebPage.h >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.h (revision 240927) >+++ Source/WebKit/WebProcess/WebPage/WebPage.h (working copy) >@@ -942,7 +942,7 @@ public: > bool platformPrefersTextLegibilityBasedZoomScaling() const; > const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; } > >- void hardwareKeyboardAvailabilityChanged(); >+ void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached); > > void updateStringForFind(const String&); > #endif >@@ -1827,6 +1827,9 @@ private: > OptionSet<LayerTreeFreezeReason> m_LayerTreeFreezeReasons; > bool m_isSuspended { false }; > bool m_needsFontAttributes { false }; >+#if PLATFORM(IOS_FAMILY) >+ bool m_keyboardIsAttached { false }; >+#endif > }; > > } // namespace WebKit >Index: Source/WebKit/WebProcess/WebPage/WebPage.messages.in >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.messages.in (revision 240927) >+++ Source/WebKit/WebProcess/WebPage/WebPage.messages.in (working copy) >@@ -107,7 +107,7 @@ messages -> WebPage LegacyReceiver { > StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow) > CancelAutoscroll() > RequestFocusedElementInformation(WebKit::CallbackID callbackID) >- HardwareKeyboardAvailabilityChanged() >+ HardwareKeyboardAvailabilityChanged(bool keyboardIsAttached) > #endif > > SetControlledByAutomation(bool controlled) >Index: Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (revision 240927) >+++ Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (working copy) >@@ -201,7 +201,7 @@ void WebPage::platformEditorState(Frame& > bool needsLayout = !frame.view() || frame.view()->needsLayout(); > bool requiresPostLayoutData = frame.editor().hasComposition(); > #if !PLATFORM(IOSMAC) >- requiresPostLayoutData |= [UIKeyboard isInHardwareKeyboardMode]; >+ requiresPostLayoutData |= m_keyboardIsAttached; > #endif > if (shouldIncludePostLayoutData == IncludePostLayoutDataHint::No && needsLayout && !requiresPostLayoutData) { > result.isMissingPostLayoutData = true; >@@ -3131,8 +3131,10 @@ String WebPage::platformUserAgent(const > return String(); > } > >-void WebPage::hardwareKeyboardAvailabilityChanged() >+void WebPage::hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached) > { >+ m_keyboardIsAttached = keyboardIsAttached; >+ > if (auto* focusedFrame = m_page->focusController().focusedFrame()) > focusedFrame->eventHandler().capsLockStateMayHaveChanged(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193683
:
359772
|
359802
|
359920
|
360902
|
360912
|
361064
|
363007
|
363107
|
363119
|
363246
|
363249