WebKit Bugzilla
Attachment 347340 Details for
Bug 183621
: Add support for the `inputmode` attribute
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-183621-20180816195121.patch (text/plain), 21.20 KB, created by
Aditya Keerthi
on 2018-08-16 19:51:22 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Aditya Keerthi
Created:
2018-08-16 19:51:22 PDT
Size:
21.20 KB
patch
obsolete
>Subversion Revision: 234957 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bd0b42bd3c0e49e42449fa1149a93b8c6911f5ad..9f419b7581d23a6cf86465228fe66b22303ec7c8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2018-08-16 Aditya Keerthi <akeerthi@apple.com> >+ >+ [iOS] Add support for the inputmode attribute >+ https://bugs.webkit.org/show_bug.cgi?id=183621 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL >+ files. The possible values for the attribute are specified in InputModeNames. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * html/HTMLAttributeNames.in: >+ * html/HTMLInputElement.idl: >+ * html/HTMLTextAreaElement.idl: >+ * html/InputModeNames.cpp: Added. >+ (WebCore::InputModeNames::text): >+ (WebCore::InputModeNames::tel): >+ (WebCore::InputModeNames::url): >+ (WebCore::InputModeNames::email): >+ (WebCore::InputModeNames::numeric): >+ (WebCore::InputModeNames::decimal): >+ (WebCore::InputModeNames::search): >+ * html/InputModeNames.h: Added. >+ > 2018-08-16 Ryosuke Niwa <rniwa@webkit.org> > > Custom element constructor doesn't use HTMLElement in new.target's realm >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8b394d50fcf4a732bb6e2b139479e47a9b59ed5c..c0f2ead43e9d7a13b3ee8559d5c29323ece12cc1 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,36 @@ >+2018-08-16 Aditya Keerthi <akeerthi@apple.com> >+ >+ [iOS] Add support for the inputmode attribute >+ https://bugs.webkit.org/show_bug.cgi?id=183621 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The inputmode attribute specifies which input mechanism would be most helpful for >+ users entering content in textfield inputs and textareas. This patch adds support >+ for seven values: text, tel, url, email, numeric, decimal and search. >+ >+ On iOS, we can specify UIKeyboardTypes that best match the supplied inputmode. >+ - text: UIKeyboardTypeDefault >+ - tel: UIKeyboardTypePhonePad >+ - url: UIKeyboardTypeURL >+ - email: UIKeyboardTypeEmailAddress >+ - numeric: UIKeyboardTypeNumberPad >+ - decimal: UIKeyboardTypeDecimalPad >+ - search: UIKeyboardTypeWebSearch >+ >+ In the case that the inputmode attribute is not specified, we fall back to using >+ our current heuristics to determine what kind of keyboard to show for textfields. >+ >+ * Shared/AssistedNodeInformation.cpp: >+ (WebKit::AssistedNodeInformation::encode const): >+ (WebKit::AssistedNodeInformation::decode): >+ * Shared/AssistedNodeInformation.h: Added inputMode field. >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView textInputTraits]): >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::inputModeForElement): >+ (WebKit::WebPage::getAssistedNodeInformation): >+ > 2018-08-16 Alex Christensen <achristensen@webkit.org> > > Consolidate data/string API loading paths >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 81288422faa54410f2c08023bbf94887613f47c9..1cc5d00d8610c307df93e3d7bd47ac80fa63d17f 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -4790,6 +4790,8 @@ > E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */ = {isa = PBXBuildFile; fileRef = E517670220B88C1400D41167 /* DataListSuggestionInformation.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E52CF54D20A268AC00DADA27 /* DataListSuggestionsClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54C20A268AC00DADA27 /* DataListSuggestionsClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ E52EFDF42112875A00AD282A /* InputModeNames.h in Headers */ = {isa = PBXBuildFile; fileRef = E52EFDF22112875A00AD282A /* InputModeNames.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ E52EFDF52112875A00AD282A /* InputModeNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E52EFDF32112875A00AD282A /* InputModeNames.cpp */; }; > E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E58B45B820AD07DD00991025 /* DataListButtonElement.h */; }; > E58B45BB20AD07DD00991025 /* DataListButtonElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */; }; > E5BA7D63151437CA00FE1E3F /* LengthFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = E5BA7D62151437CA00FE1E3F /* LengthFunctions.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -14523,6 +14525,8 @@ > E526AF3E1727F8F200E41781 /* Performance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Performance.cpp; sourceTree = "<group>"; }; > E52CF54C20A268AC00DADA27 /* DataListSuggestionsClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionsClient.h; sourceTree = "<group>"; }; > E52CF54E20A35A2800DADA27 /* DataListSuggestionPicker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListSuggestionPicker.h; sourceTree = "<group>"; }; >+ E52EFDF22112875A00AD282A /* InputModeNames.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InputModeNames.h; sourceTree = "<group>"; }; >+ E52EFDF32112875A00AD282A /* InputModeNames.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InputModeNames.cpp; sourceTree = "<group>"; }; > E55F4979151B888000BB67DB /* LengthFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthFunctions.cpp; sourceTree = "<group>"; }; > E58B45B820AD07DD00991025 /* DataListButtonElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataListButtonElement.h; sourceTree = "<group>"; }; > E58B45B920AD07DD00991025 /* DataListButtonElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DataListButtonElement.cpp; sourceTree = "<group>"; }; >@@ -20804,6 +20808,8 @@ > 97205AB21239291000B17380 /* ImageDocument.h */, > F55B3D8D1251F12D003EF269 /* ImageInputType.cpp */, > F55B3D8E1251F12D003EF269 /* ImageInputType.h */, >+ E52EFDF32112875A00AD282A /* InputModeNames.cpp */, >+ E52EFDF22112875A00AD282A /* InputModeNames.h */, > 37E3524A12450C5200BAF5D9 /* InputType.cpp */, > 37E3524C12450C6600BAF5D9 /* InputType.h */, > C348612115FDE21E007A1CC9 /* InputTypeNames.cpp */, >@@ -28434,6 +28440,7 @@ > 1C010701192594DF008A4201 /* InlineTextBoxStyle.h in Headers */, > 510A58E51BAA40B100C19282 /* InProcessIDBServer.h in Headers */, > 2EB767571DA19BDF003E23B5 /* InputEvent.h in Headers */, >+ E52EFDF42112875A00AD282A /* InputModeNames.h in Headers */, > 37E3524D12450C6600BAF5D9 /* InputType.h in Headers */, > C348612415FDE21E007A1CC9 /* InputTypeNames.h in Headers */, > 93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */, >@@ -31568,6 +31575,7 @@ > 07367DE0172CA68200D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.mm in Sources */, > BE16C59417CFE17200852C04 /* InbandWebVTTTextTrack.cpp in Sources */, > CD063F821E23FA8900812BE3 /* InitDataRegistry.cpp in Sources */, >+ E52EFDF52112875A00AD282A /* InputModeNames.cpp in Sources */, > 538EC93E1F99BF5A004D22A8 /* JSQuickTimePluginReplacement.cpp in Sources */, > 935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */, > CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */, >diff --git a/Source/WebCore/html/HTMLAttributeNames.in b/Source/WebCore/html/HTMLAttributeNames.in >index 6e665047ed58574616e9bdc6f1c4ca1917f4e224..794b774e2e46d3f65e76598fb4a609a03b8d4b81 100644 >--- a/Source/WebCore/html/HTMLAttributeNames.in >+++ b/Source/WebCore/html/HTMLAttributeNames.in >@@ -144,6 +144,7 @@ http_equiv > id > incremental > indeterminate >+inputmode > integrity > is > ismap >diff --git a/Source/WebCore/html/HTMLInputElement.idl b/Source/WebCore/html/HTMLInputElement.idl >index e9658294f101badd4b744105e1d1d2dd6e29a150..f8a4298018f4dc046a1e5f80a2348980e31bd1de 100644 >--- a/Source/WebCore/html/HTMLInputElement.idl >+++ b/Source/WebCore/html/HTMLInputElement.idl >@@ -42,6 +42,7 @@ > [Reflect] attribute DOMString formTarget; > attribute unsigned long height; > attribute boolean indeterminate; >+ [Reflect] attribute DOMString inputmode; > [Conditional=DATALIST_ELEMENT] readonly attribute HTMLElement list; > [Reflect] attribute DOMString max; > attribute long minLength; >diff --git a/Source/WebCore/html/HTMLTextAreaElement.idl b/Source/WebCore/html/HTMLTextAreaElement.idl >index b8540165275e1cd3774583a4b7c7a67d81b22b93..f3dc2a5ef844b3e6124d5478f8711629754b5ffd 100644 >--- a/Source/WebCore/html/HTMLTextAreaElement.idl >+++ b/Source/WebCore/html/HTMLTextAreaElement.idl >@@ -59,4 +59,5 @@ interface HTMLTextAreaElement : HTMLElement { > void setSelectionRange(optional long start = 0, optional long end = 0, optional DOMString direction); > > attribute DOMString autocomplete; >+ [Reflect] attribute DOMString inputmode; > }; >diff --git a/Source/WebCore/html/InputModeNames.cpp b/Source/WebCore/html/InputModeNames.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..f085b1320f5c517d2b414c5f72d4a87fc3f335ed >--- /dev/null >+++ b/Source/WebCore/html/InputModeNames.cpp >@@ -0,0 +1,79 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "InputModeNames.h" >+ >+#include <wtf/NeverDestroyed.h> >+ >+namespace WebCore { >+ >+namespace InputModeNames { >+ >+const AtomicString& text() >+{ >+ static NeverDestroyed<AtomicString> mode("text", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& tel() >+{ >+ static NeverDestroyed<AtomicString> mode("tel", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& url() >+{ >+ static NeverDestroyed<AtomicString> mode("url", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& email() >+{ >+ static NeverDestroyed<AtomicString> mode("email", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& numeric() >+{ >+ static NeverDestroyed<AtomicString> mode("numeric", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& decimal() >+{ >+ static NeverDestroyed<AtomicString> mode("decimal", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+const AtomicString& search() >+{ >+ static NeverDestroyed<AtomicString> mode("search", AtomicString::ConstructFromLiteral); >+ return mode; >+} >+ >+} // namespace WebCore::InputModeNames >+ >+} // namespace WebCore >diff --git a/Source/WebCore/html/InputModeNames.h b/Source/WebCore/html/InputModeNames.h >new file mode 100644 >index 0000000000000000000000000000000000000000..6c730813bd7206957d033c39d71f7caa8f258328 >--- /dev/null >+++ b/Source/WebCore/html/InputModeNames.h >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/text/AtomicString.h> >+ >+namespace WebCore { >+ >+namespace InputModeNames { >+ >+WEBCORE_EXPORT const AtomicString& text(); >+WEBCORE_EXPORT const AtomicString& tel(); >+WEBCORE_EXPORT const AtomicString& url(); >+WEBCORE_EXPORT const AtomicString& email(); >+WEBCORE_EXPORT const AtomicString& numeric(); >+WEBCORE_EXPORT const AtomicString& decimal(); >+WEBCORE_EXPORT const AtomicString& search(); >+ >+} >+ >+} // namespace WebCore >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.cpp b/Source/WebKit/Shared/AssistedNodeInformation.cpp >index 1cd7ac8fc9f6676cc620a856620775cb0de057f8..3200af1acf386c4b32f85a9924dc1c57e924f89c 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.cpp >+++ b/Source/WebKit/Shared/AssistedNodeInformation.cpp >@@ -77,6 +77,7 @@ void AssistedNodeInformation::encode(IPC::Encoder& encoder) const > encoder << isRTL; > encoder.encodeEnum(autocapitalizeType); > encoder.encodeEnum(elementType); >+ encoder.encodeEnum(inputMode); > encoder << formAction; > encoder << selectOptions; > encoder << selectedIndex; >@@ -142,6 +143,9 @@ bool AssistedNodeInformation::decode(IPC::Decoder& decoder, AssistedNodeInformat > if (!decoder.decodeEnum(result.elementType)) > return false; > >+ if (!decoder.decodeEnum(result.inputMode)) >+ return false; >+ > if (!decoder.decode(result.formAction)) > return false; > >diff --git a/Source/WebKit/Shared/AssistedNodeInformation.h b/Source/WebKit/Shared/AssistedNodeInformation.h >index 6b0ce17a1afb1ec2b83f208dd1710109e89b86b3..d2ca7b40d90bdf81fe71be2a96000ff8a0889403 100644 >--- a/Source/WebKit/Shared/AssistedNodeInformation.h >+++ b/Source/WebKit/Shared/AssistedNodeInformation.h >@@ -58,6 +58,17 @@ enum class InputType { > #endif > }; > >+enum class InputMode { >+ Auto, >+ Text, >+ Telephone, >+ Url, >+ Email, >+ Numeric, >+ Decimal, >+ Search >+}; >+ > #if PLATFORM(IOS) > struct OptionItem { > OptionItem() { } >@@ -109,6 +120,7 @@ struct AssistedNodeInformation { > bool insideFixedPosition { false }; > AutocapitalizeType autocapitalizeType { AutocapitalizeTypeDefault }; > InputType elementType { InputType::None }; >+ InputMode inputMode { InputMode::Auto }; > String formAction; > Vector<OptionItem> selectOptions; > int selectedIndex { -1 }; >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 470741fe7fa3c6dd8439923a17954445c6be1122..9b9279219942225f4d101bb494743b0b41def2d8 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -3533,24 +3533,49 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName) > [_traits setAutocorrectionType:_assistedNodeInformation.isAutocorrect ? UITextAutocorrectionTypeYes : UITextAutocorrectionTypeNo]; > } > >- switch (_assistedNodeInformation.elementType) { >- case InputType::Phone: >+ switch (_assistedNodeInformation.inputMode) { >+ case InputMode::Auto: >+ switch (_assistedNodeInformation.elementType) { >+ case InputType::Phone: >+ [_traits setKeyboardType:UIKeyboardTypePhonePad]; >+ break; >+ case InputType::URL: >+ [_traits setKeyboardType:UIKeyboardTypeURL]; >+ break; >+ case InputType::Email: >+ [_traits setKeyboardType:UIKeyboardTypeEmailAddress]; >+ break; >+ case InputType::Number: >+ [_traits setKeyboardType:UIKeyboardTypeNumbersAndPunctuation]; >+ break; >+ case InputType::NumberPad: >+ [_traits setKeyboardType:UIKeyboardTypeNumberPad]; >+ break; >+ default: >+ [_traits setKeyboardType:UIKeyboardTypeDefault]; >+ } >+ break; >+ case InputMode::Text: >+ [_traits setKeyboardType:UIKeyboardTypeDefault]; >+ break; >+ case InputMode::Telephone: > [_traits setKeyboardType:UIKeyboardTypePhonePad]; > break; >- case InputType::URL: >+ case InputMode::Url: > [_traits setKeyboardType:UIKeyboardTypeURL]; > break; >- case InputType::Email: >+ case InputMode::Email: > [_traits setKeyboardType:UIKeyboardTypeEmailAddress]; > break; >- case InputType::Number: >- [_traits setKeyboardType:UIKeyboardTypeNumbersAndPunctuation]; >- break; >- case InputType::NumberPad: >+ case InputMode::Numeric: > [_traits setKeyboardType:UIKeyboardTypeNumberPad]; > break; >- default: >- [_traits setKeyboardType:UIKeyboardTypeDefault]; >+ case InputMode::Decimal: >+ [_traits setKeyboardType:UIKeyboardTypeDecimalPad]; >+ break; >+ case InputMode::Search: >+ [_traits setKeyboardType:UIKeyboardTypeWebSearch]; >+ break; > } > > [_traits setTextContentType:contentTypeFromFieldName(_assistedNodeInformation.autofillFieldName)]; >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index a9cadce820488f8c3645d1c26dbaa653d98c80be..4faacdf5c30a7987f841f5e1a0fe898580a56dba 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -86,6 +86,7 @@ > #import <WebCore/HTMLTextAreaElement.h> > #import <WebCore/HistoryItem.h> > #import <WebCore/HitTestResult.h> >+#import <WebCore/InputModeNames.h> > #import <WebCore/KeyboardEvent.h> > #import <WebCore/LibWebRTCProvider.h> > #import <WebCore/MediaSessionManagerIOS.h> >@@ -2297,6 +2298,27 @@ static IntRect elementRectInRootViewCoordinates(const Node& node, const Frame& f > return view->contentsToRootView(renderer->absoluteBoundingBoxRect()); > } > >+static InputMode inputModeForElement(const Element& element) >+{ >+ AtomicString inputMode = element.attributeWithoutSynchronization(HTMLNames::inputmodeAttr); >+ if (inputMode == InputModeNames::text()) >+ return InputMode::Text; >+ if (inputMode == InputModeNames::tel()) >+ return InputMode::Telephone; >+ if (inputMode == InputModeNames::url()) >+ return InputMode::Url; >+ if (inputMode == InputModeNames::email()) >+ return InputMode::Email; >+ if (inputMode == InputModeNames::numeric()) >+ return InputMode::Numeric; >+ if (inputMode == InputModeNames::decimal()) >+ return InputMode::Decimal; >+ if (inputMode == InputModeNames::search()) >+ return InputMode::Search; >+ >+ return InputMode::Auto; >+} >+ > void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information) > { > layoutIfNeeded(); >@@ -2402,6 +2424,7 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information) > information.value = element.value(); > information.autofillFieldName = WebCore::toAutofillFieldName(element.autofillData().fieldName); > information.placeholder = element.attributeWithoutSynchronization(HTMLNames::placeholderAttr); >+ information.inputMode = inputModeForElement(element); > } else if (is<HTMLInputElement>(*m_assistedNode)) { > HTMLInputElement& element = downcast<HTMLInputElement>(*m_assistedNode); > HTMLFormElement* form = element.form(); >@@ -2455,6 +2478,7 @@ void WebPage::getAssistedNodeInformation(AssistedNodeInformation& information) > information.elementType = InputType::Color; > #endif > >+ information.inputMode = inputModeForElement(element); > information.isReadOnly = element.isReadOnly(); > information.value = element.value(); > information.valueAsNumber = element.valueAsNumber();
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 183621
:
347340
|
347396
|
347413
|
347504
|
347720
|
347812
|
347820