Unreviewed, rolling out r242396.
authortsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 00:09:15 +0000 (00:09 +0000)
committertsavell@apple.com <tsavell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2019 00:09:15 +0000 (00:09 +0000)
Found issue to be unrelated. reverting my rollout.

Reverted changeset:

"Unreviewed, rolling out r242222."
https://bugs.webkit.org/show_bug.cgi?id=193683
https://trac.webkit.org/changeset/242396

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242400 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

index 1fcc23e..6188332 100644 (file)
@@ -1,3 +1,15 @@
+2019-03-04  Truitt Savell  <tsavell@apple.com>
+
+        Unreviewed, rolling out r242396.
+
+        Found issue to be unrelated. reverting my rollout.
+
+        Reverted changeset:
+
+        "Unreviewed, rolling out r242222."
+        https://bugs.webkit.org/show_bug.cgi?id=193683
+        https://trac.webkit.org/changeset/242396
+
 2019-03-04  Jiewen Tan  <jiewen_tan@apple.com>
 
         Unreviewed, a followup after r242336
index 0420ebc..7965a1e 100644 (file)
@@ -3303,7 +3303,9 @@ static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef,
 {
     ASSERT(observer);
     WKWebView *webView = (__bridge WKWebView *)observer;
-    webView._page->hardwareKeyboardAvailabilityChanged();
+    auto keyboardIsAttached = GSEventIsHardwareKeyboardAttached();
+    webView._page->process().setKeyboardIsAttached(keyboardIsAttached);
+    webView._page->hardwareKeyboardAvailabilityChanged(keyboardIsAttached);
 }
 
 - (void)_windowDidRotate:(NSNotification *)notification
index 591a319..2155d14 100644 (file)
@@ -688,7 +688,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; }
     void requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&&);
 #if ENABLE(DATA_INTERACTION)
index 02ff046..e3d8f8f 100644 (file)
@@ -269,6 +269,11 @@ public:
     void sendProcessDidResume() override;
     void didSetAssertionState(AssertionState) override;
 
+#if PLATFORM(IOS_FAMILY)
+    void setKeyboardIsAttached(bool keyboardIsAttached) { m_keyboardIsAttached = keyboardIsAttached; }
+    bool keyboardIsAttached() const { return m_keyboardIsAttached; }
+#endif
+
 #if PLATFORM(COCOA)
     enum SandboxExtensionType : uint32_t {
         None = 0,
@@ -458,6 +463,10 @@ private:
     ProcessThrottler::BackgroundActivityToken m_backgroundActivityTokenForFullscreenFormControls;
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+    bool m_keyboardIsAttached { false };
+#endif
+
 #if PLATFORM(COCOA)
     MediaCaptureSandboxExtensions m_mediaCaptureSandboxExtensions { SandboxExtensionType::None };
 #endif
index 1ce4ef5..37b3620 100644 (file)
@@ -4850,7 +4850,7 @@ static const double minimumFocusedElementAreaForSuppressingSelectionAssistant =
                 if (_isChangingFocus)
                     return YES;
 
-                if (UIKeyboard.isInHardwareKeyboardMode)
+                if (_page->process().keyboardIsAttached())
                     return YES;
 #endif
             }
index 44f4b25..6d185fd 100644 (file)
@@ -671,6 +671,8 @@ void WebPageProxy::applicationWillEnterForeground()
 {
     bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
     m_process->send(Messages::WebPage::ApplicationWillEnterForeground(isSuspendedUnderLock), m_pageID);
+    m_process->setKeyboardIsAttached([UIKeyboard isInHardwareKeyboardMode]);
+    m_process->send(Messages::WebPage::HardwareKeyboardAvailabilityChanged(m_process->keyboardIsAttached()), m_pageID);
 }
 
 void WebPageProxy::applicationWillResignActive()
@@ -1108,10 +1110,10 @@ void WebPageProxy::setIsScrollingOrZooming(bool isScrollingOrZooming)
         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);
 }
 
 void WebPageProxy::requestEvasionRectsAboveSelection(CompletionHandler<void(const Vector<WebCore::FloatRect>&)>&& callback)
index 4d9247a..26d7a99 100644 (file)
@@ -937,7 +937,7 @@ public:
     bool platformPrefersTextLegibilityBasedZoomScaling() const;
     const WebCore::ViewportConfiguration& viewportConfiguration() const { return m_viewportConfiguration; }
 
-    void hardwareKeyboardAvailabilityChanged();
+    void hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached);
 
     void updateStringForFind(const String&);
 #endif
@@ -1843,6 +1843,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 64950a9..cb0b570 100644 (file)
@@ -108,7 +108,7 @@ messages -> WebPage LegacyReceiver {
     StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow)
     CancelAutoscroll()
     RequestFocusedElementInformation(WebKit::CallbackID callbackID)
-    HardwareKeyboardAvailabilityChanged()
+    HardwareKeyboardAvailabilityChanged(bool keyboardIsAttached)
 #endif
 
     SetControlledByAutomation(bool controlled)
index f2e9a2e..42ee757 100644 (file)
@@ -203,7 +203,7 @@ void WebPage::platformEditorState(Frame& frame, EditorState& result, IncludePost
     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;
@@ -3233,8 +3233,10 @@ String WebPage::platformUserAgent(const URL&) const
     return String();
 }
 
-void WebPage::hardwareKeyboardAvailabilityChanged()
+void WebPage::hardwareKeyboardAvailabilityChanged(bool keyboardIsAttached)
 {
+    m_keyboardIsAttached = keyboardIsAttached;
+
     if (auto* focusedFrame = m_page->focusController().focusedFrame())
         focusedFrame->eventHandler().capsLockStateMayHaveChanged();
 }