Title: [240199] trunk
Revision
240199
Author
rn...@webkit.org
Date
2019-01-18 23:53:14 -0800 (Fri, 18 Jan 2019)

Log Message

iOS: Updating input mode should update the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=193565
<rdar://problem/47376334>

Reviewed by Wenson Hsieh.

Source/WebCore:

Let the chrome client know that the focused element's inputmode had changed.

Test: fast/forms/ios/inputmode-none-removed.html

* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
* page/ChromeClient.h:

Source/WebKit:

Update the software keyboard when the inputmode content attribute on the focused element had been mutated.

* Scripts/webkit/messages.py:
* Shared/WebCoreArgumentCoders.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::focusedElementDidChangeInputMode):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didUpdateInputMode:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::focusedElementDidChangeInputMode):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::focusedElementDidChangeInputMode):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::focusedElementDidChangeInputMode):
* WebProcess/WebPage/WebPage.h:

LayoutTests:

Added a regression test for removing inputmode content attribute with the value of "none".

The test methodology is different between testRunner and in-browser since we don't force
software keyboard while running layout tests inside simulator which can elimiate
the visual viewport difference inside the test runner, and in-browser testing obviously
doesn't have access to the internal keyboard metrics.

* fast/forms/ios/inputmode-none-removed-expected.txt: Added.
* fast/forms/ios/inputmode-none-removed.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240198 => 240199)


--- trunk/LayoutTests/ChangeLog	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/LayoutTests/ChangeLog	2019-01-19 07:53:14 UTC (rev 240199)
@@ -1,3 +1,21 @@
+2019-01-18  Ryosuke Niwa  <rn...@webkit.org>
+
+        iOS: Updating input mode should update the software keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=193565
+        <rdar://problem/47376334>
+
+        Reviewed by Wenson Hsieh.
+
+        Added a regression test for removing inputmode content attribute with the value of "none".
+
+        The test methodology is different between testRunner and in-browser since we don't force
+        software keyboard while running layout tests inside simulator which can elimiate
+        the visual viewport difference inside the test runner, and in-browser testing obviously
+        doesn't have access to the internal keyboard metrics.
+
+        * fast/forms/ios/inputmode-none-removed-expected.txt: Added.
+        * fast/forms/ios/inputmode-none-removed.html: Added.
+
 2019-01-18  Justin Fan  <justin_...@apple.com>
 
         (WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype

Added: trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt (0 => 240199)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-removed-expected.txt	2019-01-19 07:53:14 UTC (rev 240199)
@@ -0,0 +1,16 @@
+This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.
+To manually test, focus the input element below. The software keyboard should show up after 3 seconds
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Element has inputmode=none
+PASS keyboardRect.height is 0
+
+inputmode has been removed
+PASS keyboardRect.height > 0 is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+

Added: trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html (0 => 240199)


--- trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/ios/inputmode-none-removed.html	2019-01-19 07:53:14 UTC (rev 240199)
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+<script src=""
+<script src=""
+</head>
+<body>
+<input inputmode="none">
+<div id="countdown"></div>
+<script>
+jsTestIsAsync = true;
+
+description('This tests updating inputmode of an input element from "none" to "text". The software keyboard should be updated.<br>'
+    + 'To manually test, focus the input element below. The software keyboard should show up after 3 seconds');
+
+const input = document.querySelector("input");
+if (!window.testRunner) {
+    input.addEventListener('focus', () => {
+        let countdown = 3;
+        const id = setInterval(() => {
+            document.getElementById('countdown').textContent = countdown ? countdown : '';
+            if (!countdown) {
+                clearInterval(id);
+                input.removeAttribute('inputmode');
+            }
+            countdown--;
+        }, 1000);
+    });
+}
+
+async function runTest() {
+    debug('Element has inputmode=none');
+
+    let didResize = () => { };
+    window.visualViewport.addEventListener('resize', () => didResize());
+
+    if (window.testRunner) {
+        await UIHelper.activateFormControl(input);
+        window.keyboardRect = await UIHelper.inputViewBounds();
+        shouldBe('keyboardRect.height', '0');
+    } else {
+        await new Promise((resolve) => { didResize = resolve; });
+        shouldBeTrue('document.documentElement.clientHeight - visualViewport.height < 100');
+    }
+
+    if (window.testRunner)
+        input.removeAttribute('inputmode');
+
+    await new Promise((resolve) => { didResize = resolve; });
+
+    debug('');
+    debug('inputmode has been removed');
+
+    if (window.testRunner) {
+        window.keyboardRect = await UIHelper.inputViewBounds();
+        shouldBeTrue('keyboardRect.height > 0');
+    } else
+        shouldBeTrue('document.documentElement.clientHeight - visualViewport.height > 300');
+
+    finishJSTest();
+}
+
+window._onload_ = () => setTimeout(runTest, 0);
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (240198 => 240199)


--- trunk/Source/WebCore/ChangeLog	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebCore/ChangeLog	2019-01-19 07:53:14 UTC (rev 240199)
@@ -1,3 +1,19 @@
+2019-01-18  Ryosuke Niwa  <rn...@webkit.org>
+
+        iOS: Updating input mode should update the software keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=193565
+        <rdar://problem/47376334>
+
+        Reviewed by Wenson Hsieh.
+
+        Let the chrome client know that the focused element's inputmode had changed.
+
+        Test: fast/forms/ios/inputmode-none-removed.html
+
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseAttribute):
+        * page/ChromeClient.h:
+
 2019-01-18  Brian Burg  <bb...@apple.com>
 
         Automation.computeElementLayout should return visual viewport-aware coordinates

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (240198 => 240199)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2019-01-19 07:53:14 UTC (rev 240199)
@@ -29,6 +29,8 @@
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
 #include "CSSValuePool.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
 #include "DOMTokenList.h"
 #include "DocumentFragment.h"
 #include "ElementAncestorIterator.h"
@@ -448,6 +450,14 @@
             setTabIndexExplicitly(optionalTabIndex.value());
         return;
     }
+    
+    if (name == inputmodeAttr) {
+        auto& document = this->document();
+        if (this == document.focusedElement()) {
+            if (auto* page = document.page())
+                page->chrome().client().focusedElementDidChangeInputMode(*this, canonicalInputMode());
+        }
+    }
 
     auto& eventName = eventNameForEventHandlerAttribute(name);
     if (!eventName.isNull())

Modified: trunk/Source/WebCore/page/ChromeClient.h (240198 => 240199)


--- trunk/Source/WebCore/page/ChromeClient.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebCore/page/ChromeClient.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -34,6 +34,7 @@
 #include "HTMLMediaElementEnums.h"
 #include "HostWindow.h"
 #include "Icon.h"
+#include "InputMode.h"
 #include "LayerFlushThrottleState.h"
 #include "MediaProducer.h"
 #include "PopupMenu.h"
@@ -292,7 +293,9 @@
     virtual void elementDidFocus(Element&) { }
     virtual void elementDidBlur(Element&) { }
     virtual void elementDidRefocus(Element&) { }
-    
+
+    virtual void focusedElementDidChangeInputMode(Element&, InputMode) { }
+
     virtual bool shouldPaintEntireContents() const { return false; }
     virtual bool hasStablePageScaleFactor() const { return true; }
 

Modified: trunk/Source/WebKit/ChangeLog (240198 => 240199)


--- trunk/Source/WebKit/ChangeLog	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/ChangeLog	2019-01-19 07:53:14 UTC (rev 240199)
@@ -1,3 +1,33 @@
+2019-01-18  Ryosuke Niwa  <rn...@webkit.org>
+
+        iOS: Updating input mode should update the software keyboard
+        https://bugs.webkit.org/show_bug.cgi?id=193565
+        <rdar://problem/47376334>
+
+        Reviewed by Wenson Hsieh.
+
+        Update the software keyboard when the inputmode content attribute on the focused element had been mutated.
+
+        * Scripts/webkit/messages.py:
+        * Shared/WebCoreArgumentCoders.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::focusedElementDidChangeInputMode):
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _didUpdateInputMode:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::focusedElementDidChangeInputMode):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::focusedElementDidChangeInputMode):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::focusedElementDidChangeInputMode):
+        * WebProcess/WebPage/WebPage.h:
+
 2019-01-18  Tim Horton  <timothy_hor...@apple.com>
 
         Adjust WKDrawingView protocol method name

Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (240198 => 240199)


--- trunk/Source/WebKit/Scripts/webkit/messages.py	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py	2019-01-19 07:53:14 UTC (rev 240199)
@@ -407,6 +407,7 @@
         'WebCore::HasInsecureContent': ['<WebCore/FrameLoaderTypes.h>'],
         'WebCore::Highlight': ['<WebCore/InspectorOverlay.h>'],
         'WebCore::IncludeSecureCookies': ['<WebCore/CookieJar.h>'],
+        'WebCore::InputMode': ['<WebCore/InputMode.h>'],
         'WebCore::KeyframeValueList': ['<WebCore/GraphicsLayer.h>'],
         'WebCore::KeypressCommand': ['<WebCore/KeyboardEvent.h>'],
         'WebCore::LockBackForwardList': ['<WebCore/FrameLoaderTypes.h>'],

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h (240198 => 240199)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -32,6 +32,7 @@
 #include <WebCore/DiagnosticLoggingClient.h>
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/IndexedDB.h>
+#include <WebCore/InputMode.h>
 #include <WebCore/MediaSelectionOption.h>
 #include <WebCore/NetworkLoadMetrics.h>
 #include <WebCore/NotificationDirection.h>
@@ -766,6 +767,21 @@
     >;
 };
 
+template<> struct EnumTraits<WebCore::InputMode> {
+    using values = EnumValues<
+        WebCore::InputMode,
+        WebCore::InputMode::Unspecified,
+        WebCore::InputMode::None,
+        WebCore::InputMode::Text,
+        WebCore::InputMode::Telephone,
+        WebCore::InputMode::Url,
+        WebCore::InputMode::Email,
+        WebCore::InputMode::Numeric,
+        WebCore::InputMode::Decimal,
+        WebCore::InputMode::Search
+    >;
+};
+
 template<> struct EnumTraits<WebCore::NetworkLoadPriority> {
     using values = EnumValues<
         WebCore::NetworkLoadPriority,

Modified: trunk/Source/WebKit/UIProcess/PageClient.h (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/PageClient.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -34,6 +34,7 @@
 #include <WebCore/AlternativeTextClient.h>
 #include <WebCore/EditorClient.h>
 #include <WebCore/FocusDirection.h>
+#include <WebCore/InputMode.h>
 #include <WebCore/UserInterfaceLayoutDirection.h>
 #include <WebCore/ValidationBubble.h>
 #include <wtf/CompletionHandler.h>
@@ -371,6 +372,7 @@
 
     virtual void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) = 0;
     virtual void elementDidBlur() = 0;
+    virtual void focusedElementDidChangeInputMode(WebCore::InputMode) = 0;
     virtual void didReceiveEditorStateUpdateAfterFocus() = 0;
     virtual bool isFocusingElement() = 0;
     virtual bool interpretKeyEvent(const NativeWebKeyboardEvent&, bool isCharEvent) = 0;

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -75,6 +75,7 @@
 #include <WebCore/FontAttributes.h>
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/FrameView.h> // FIXME: Move LayoutViewportConstraint to its own file and stop including this.
+#include <WebCore/InputMode.h>
 #include <WebCore/LayoutPoint.h>
 #include <WebCore/LayoutSize.h>
 #include <WebCore/MediaPlaybackTargetContext.h>
@@ -1803,6 +1804,7 @@
 
     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, const UserData&);
     void elementDidBlur();
+    void focusedElementDidChangeInputMode(WebCore::InputMode);
     void didReceiveEditorStateUpdateAfterFocus();
 
     void showInspectorHighlight(const WebCore::Highlight&);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2019-01-19 07:53:14 UTC (rev 240199)
@@ -405,6 +405,7 @@
 
     ElementDidFocus(struct WebKit::FocusedElementInformation information, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, WebKit::UserData userData)
     ElementDidBlur()
+    FocusedElementDidChangeInputMode(enum:uint8_t WebCore::InputMode mode)
     ScrollingNodeScrollWillStartScroll()
     ScrollingNodeScrollDidEndScroll()
     ShowInspectorHighlight(struct WebCore::Highlight highlight)

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -143,6 +143,7 @@
 
     void elementDidFocus(const FocusedElementInformation&, bool userIsInteracting, bool blurPreviousNode, bool changingActivityState, API::Object* userData) override;
     void elementDidBlur() override;
+    void focusedElementDidChangeInputMode(WebCore::InputMode) override;
     void didReceiveEditorStateUpdateAfterFocus() override;
     bool isFocusingElement() override;
     void selectionDidChange() override;

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2019-01-19 07:53:14 UTC (rev 240199)
@@ -547,6 +547,11 @@
     [m_contentView _elementDidBlur];
 }
 
+void PageClientImpl::focusedElementDidChangeInputMode(WebCore::InputMode mode)
+{
+    [m_contentView _didUpdateInputMode:mode];
+}
+
 void PageClientImpl::didReceiveEditorStateUpdateAfterFocus()
 {
     [m_contentView _didReceiveEditorStateUpdateAfterFocus];

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -388,6 +388,7 @@
 - (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
 - (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode changingActivityState:(BOOL)changingActivityState userObject:(NSObject <NSSecureCoding> *)userObject;
 - (void)_elementDidBlur;
+- (void)_didUpdateInputMode:(WebCore::InputMode)mode;
 - (void)_didReceiveEditorStateUpdateAfterFocus;
 - (void)_selectionChanged;
 - (void)_updateChangedSelection;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-01-19 07:53:14 UTC (rev 240199)
@@ -4637,6 +4637,17 @@
     }
 }
 
+- (void)_didUpdateInputMode:(WebCore::InputMode)mode
+{
+    if (!self.inputDelegate || _focusedElementInformation.elementType == WebKit::InputType::None)
+        return;
+
+#if !PLATFORM(WATCHOS)
+    _focusedElementInformation.inputMode = mode;
+    [self reloadInputViews];
+#endif
+}
+
 - (void)_didReceiveEditorStateUpdateAfterFocus
 {
     [self _updateInitialWritingDirectionIfNecessary];

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (240198 => 240199)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-01-19 07:53:14 UTC (rev 240199)
@@ -920,6 +920,11 @@
     pageClient().elementDidBlur();
 }
 
+void WebPageProxy::focusedElementDidChangeInputMode(WebCore::InputMode mode)
+{
+    pageClient().focusedElementDidChangeInputMode(mode);
+}
+
 void WebPageProxy::autofillLoginCredentials(const String& username, const String& password)
 {
     m_process->send(Messages::WebPage::AutofillLoginCredentials(username, password), m_pageID);

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (240198 => 240199)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp	2019-01-19 07:53:14 UTC (rev 240199)
@@ -213,6 +213,11 @@
     m_page.elementDidBlur(element);
 }
 
+void WebChromeClient::focusedElementDidChangeInputMode(Element& element, InputMode mode)
+{
+    m_page.focusedElementDidChangeInputMode(element, mode);
+}
+
 void WebChromeClient::makeFirstResponder()
 {
     m_page.send(Messages::WebPageProxy::MakeFirstResponder());

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (240198 => 240199)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -275,6 +275,7 @@
     void elementDidFocus(WebCore::Element&) final;
     void elementDidBlur(WebCore::Element&) final;
     void elementDidRefocus(WebCore::Element&) final;
+    void focusedElementDidChangeInputMode(WebCore::Element&, WebCore::InputMode) final;
 
     void makeFirstResponder() final;
     void assistiveTechnologyMakeFirstResponder() final;

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (240198 => 240199)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2019-01-19 07:53:14 UTC (rev 240199)
@@ -172,6 +172,7 @@
 #include <WebCore/HTMLOListElement.h>
 #include <WebCore/HTMLPlugInElement.h>
 #include <WebCore/HTMLPlugInImageElement.h>
+#include <WebCore/HTMLTextAreaElement.h>
 #include <WebCore/HTMLUListElement.h>
 #include <WebCore/HistoryController.h>
 #include <WebCore/HistoryItem.h>
@@ -5360,6 +5361,22 @@
     }
 }
 
+void WebPage::focusedElementDidChangeInputMode(WebCore::Element& element, WebCore::InputMode mode)
+{
+#if PLATFORM(IOS_FAMILY)
+    ASSERT(m_focusedElement == &element);
+    ASSERT(element.canonicalInputMode() == mode);
+
+    if (!is<HTMLTextAreaElement>(*m_focusedElement) && !is<HTMLInputElement>(*m_focusedElement) && !m_focusedElement->hasEditableStyle())
+        return;
+
+    send(Messages::WebPageProxy::FocusedElementDidChangeInputMode(mode));
+#else
+    UNUSED_PARAM(element);
+    UNUSED_PARAM(mode);
+#endif
+}
+
 void WebPage::didUpdateComposition()
 {
     sendEditorStateUpdate();

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (240198 => 240199)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-01-19 05:42:58 UTC (rev 240198)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2019-01-19 07:53:14 UTC (rev 240199)
@@ -589,6 +589,7 @@
     void elementDidFocus(WebCore::Element&);
     void elementDidRefocus(WebCore::Element&);
     void elementDidBlur(WebCore::Element&);
+    void focusedElementDidChangeInputMode(WebCore::Element&, WebCore::InputMode);
     void resetFocusedElementForFrame(WebFrame*);
 
     void disabledAdaptationsDidChange(const OptionSet<WebCore::DisabledAdaptations>&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to