Changeset 251720 in webkit
- Timestamp:
- Oct 29, 2019, 12:39:47 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/Shared/FocusedElementInformation.cpp (modified) (2 diffs)
-
Source/WebKit/Shared/FocusedElementInformation.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (3 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/ios/EnterKeyHintTests.mm (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r251718 r251720 1 2019-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add enterkeyhint support 4 https://bugs.webkit.org/show_bug.cgi?id=189546 5 <rdar://problem/51021148> 6 7 Reviewed by Tim Horton. 8 9 * Headers.cmake: Add EnterKeyHint.h. 10 1 11 2019-10-29 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/Source/WebCore/Headers.cmake
r251655 r251720 542 542 html/DOMTokenList.h 543 543 html/DataListSuggestionInformation.h 544 html/EnterKeyHint.h 544 545 html/FeaturePolicy.h 545 546 html/FormAssociatedElement.h -
trunk/Source/WebKit/ChangeLog
r251719 r251720 1 2019-10-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add enterkeyhint support 4 https://bugs.webkit.org/show_bug.cgi?id=189546 5 <rdar://problem/51021148> 6 7 Reviewed by Tim Horton. 8 9 This patch adds support for the enterkeyhint HTML attribute on iOS. 10 11 Tests: EnterKeyHintTests.EnterKeyHintInContentEditableElement 12 EnterKeyHintTests.EnterKeyHintInTextInput 13 EnterKeyHintTests.EnterKeyHintInTextArea 14 15 * Shared/FocusedElementInformation.cpp: 16 (WebKit::FocusedElementInformation::encode const): 17 (WebKit::FocusedElementInformation::decode): 18 * Shared/FocusedElementInformation.h: 19 20 Add a new flag to FocusedElementInformation to indicate the EnterKeyHint type that should be used when bringing 21 up an input view for the focused element. 22 23 * UIProcess/ios/WKContentViewInteraction.mm: 24 (-[WKContentView textInputTraits]): 25 26 Map the given EnterKeyHint type to a UIReturnKeyType. If an unsupported (i.e. "previous") or default 27 EnterKeyHint value is used, then we fall back to existing behavior which deduces the default enterkeyhint value 28 from the input type if the focused element is inside an actionable form; otherwise, we avoid setting any value 29 for the `returnKeyType`, defaulting to `UIReturnKeyDefault`. 30 31 * WebProcess/WebPage/ios/WebPageIOS.mm: 32 (WebKit::WebPage::getFocusedElementInformation): 33 1 34 2019-10-29 Kate Cheney <katherine_cheney@apple.com> 2 35 -
trunk/Source/WebKit/Shared/FocusedElementInformation.cpp
r251693 r251720 80 80 encoder.encodeEnum(elementType); 81 81 encoder.encodeEnum(inputMode); 82 encoder.encodeEnum(enterKeyHint); 82 83 encoder << formAction; 83 84 encoder << selectOptions; … … 163 164 return false; 164 165 166 if (!decoder.decodeEnum(result.enterKeyHint)) 167 return false; 168 165 169 if (!decoder.decode(result.formAction)) 166 170 return false; -
trunk/Source/WebKit/Shared/FocusedElementInformation.h
r251693 r251720 31 31 #include <WebCore/Color.h> 32 32 #include <WebCore/ElementContext.h> 33 #include <WebCore/EnterKeyHint.h> 33 34 #include <WebCore/GraphicsLayer.h> 34 35 #include <WebCore/InputMode.h> … … 119 120 InputType elementType { InputType::None }; 120 121 WebCore::InputMode inputMode { WebCore::InputMode::Unspecified }; 122 WebCore::EnterKeyHint enterKeyHint { WebCore::EnterKeyHint::Unspecified }; 121 123 String formAction; 122 124 Vector<OptionItem> selectOptions; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r251693 r251720 4710 4710 [_traits setShortcutConversionType:_focusedElementInformation.elementType == WebKit::InputType::Password ? UITextShortcutConversionTypeNo : UITextShortcutConversionTypeDefault]; 4711 4711 4712 if (!_focusedElementInformation.formAction.isEmpty()) 4713 [_traits setReturnKeyType:(_focusedElementInformation.elementType == WebKit::InputType::Search) ? UIReturnKeySearch : UIReturnKeyGo]; 4712 switch (_focusedElementInformation.enterKeyHint) { 4713 case WebCore::EnterKeyHint::Enter: 4714 [_traits setReturnKeyType:UIReturnKeyDefault]; 4715 break; 4716 case WebCore::EnterKeyHint::Done: 4717 [_traits setReturnKeyType:UIReturnKeyDone]; 4718 break; 4719 case WebCore::EnterKeyHint::Go: 4720 [_traits setReturnKeyType:UIReturnKeyGo]; 4721 break; 4722 case WebCore::EnterKeyHint::Next: 4723 [_traits setReturnKeyType:UIReturnKeyNext]; 4724 break; 4725 case WebCore::EnterKeyHint::Search: 4726 [_traits setReturnKeyType:UIReturnKeySearch]; 4727 break; 4728 case WebCore::EnterKeyHint::Send: 4729 [_traits setReturnKeyType:UIReturnKeySend]; 4730 break; 4731 default: { 4732 if (!_focusedElementInformation.formAction.isEmpty()) 4733 [_traits setReturnKeyType:_focusedElementInformation.elementType == WebKit::InputType::Search ? UIReturnKeySearch : UIReturnKeyGo]; 4734 } 4735 } 4714 4736 4715 4737 if (_focusedElementInformation.elementType == WebKit::InputType::Password || _focusedElementInformation.elementType == WebKit::InputType::Email || _focusedElementInformation.elementType == WebKit::InputType::URL || _focusedElementInformation.formAction.contains("login")) { -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r251693 r251720 2988 2988 information.placeholder = element.attributeWithoutSynchronization(HTMLNames::placeholderAttr); 2989 2989 information.inputMode = element.canonicalInputMode(); 2990 information.enterKeyHint = element.canonicalEnterKeyHint(); 2990 2991 } else if (is<HTMLInputElement>(*m_focusedElement)) { 2991 2992 HTMLInputElement& element = downcast<HTMLInputElement>(*m_focusedElement); … … 3049 3050 #endif 3050 3051 information.inputMode = element.canonicalInputMode(); 3052 information.enterKeyHint = element.canonicalEnterKeyHint(); 3051 3053 information.isReadOnly = element.isReadOnly(); 3052 3054 information.value = element.value(); … … 3063 3065 information.autocapitalizeType = focusedElement.autocapitalizeType(); 3064 3066 information.inputMode = focusedElement.canonicalInputMode(); 3067 information.enterKeyHint = focusedElement.canonicalEnterKeyHint(); 3065 3068 information.shouldSynthesizeKeyEventsForEditing = focusedElement.document().settings().syntheticEditingCommandsEnabled(); 3066 3069 } else { -
trunk/Tools/ChangeLog
r251712 r251720 1 2019-10-27 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Add enterkeyhint support 4 https://bugs.webkit.org/show_bug.cgi?id=189546 5 <rdar://problem/51021148> 6 7 Reviewed by Tim Horton. 8 9 Add new API tests to check the resulting UIReturnKeyType that gets set on text input traits in the UI process, 10 given the different values for "enterkeyhint". Also verifies that the default behaviors of search fields and 11 text input fields inside actionable form elements is to show "Search" or "Go" as the return key by default, 12 unless a different value for "enterkeyhint" is specified. 13 14 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 15 * TestWebKitAPI/Tests/ios/EnterKeyHintTests.mm: Added. 16 (-[TestWKWebView test:enterKeyHint:returnKeyType:]): 17 (TestWebKitAPI::enterKeyHintTestCases): 18 (TestWebKitAPI::createWebViewAndInputDelegateForTesting): 19 (TestWebKitAPI::TEST): 20 1 21 2019-10-29 Truitt Savell <tsavell@apple.com> 2 22 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r251709 r251720 1033 1033 F4CD74C620FDACFA00DE3794 /* text-with-async-script.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4CD74C520FDACF500DE3794 /* text-with-async-script.html */; }; 1034 1034 F4CD74C920FDB49600DE3794 /* TestURLSchemeHandler.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */; }; 1035 F4CF32802366552200D3AD07 /* EnterKeyHintTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4CF327F2366552200D3AD07 /* EnterKeyHintTests.mm */; }; 1035 1036 F4D2986E20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D2986D20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm */; }; 1036 1037 F4D4F3B61E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */; }; … … 2558 2559 F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestURLSchemeHandler.mm; sourceTree = "<group>"; }; 2559 2560 F4CDAB3322489FE10057A2D9 /* IPadUserInterfaceSwizzler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IPadUserInterfaceSwizzler.h; sourceTree = "<group>"; }; 2561 F4CF327F2366552200D3AD07 /* EnterKeyHintTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = EnterKeyHintTests.mm; sourceTree = "<group>"; }; 2560 2562 F4D2986D20FEE7370092D636 /* RunScriptAfterDocumentLoad.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RunScriptAfterDocumentLoad.mm; sourceTree = "<group>"; }; 2561 2563 F4D4F3B41E4E2BCB00BB2767 /* DragAndDropSimulatorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DragAndDropSimulatorIOS.mm; sourceTree = "<group>"; }; … … 3137 3139 44077BB0231449D200179E2D /* DataDetectorsTestIOS.mm */, 3138 3140 F4D4F3B71E4E36E400BB2767 /* DragAndDropTestsIOS.mm */, 3141 F4CF327F2366552200D3AD07 /* EnterKeyHintTests.mm */, 3139 3142 F4BC0B132146C849002A0478 /* FocusPreservationTests.mm */, 3140 3143 CDA93DAC22F4EC2200490A69 /* FullscreenTouchSecheuristicTests.cpp */, … … 4567 4570 F44D06471F39627A001A0E29 /* EditorStateTests.mm in Sources */, 4568 4571 7CCE7EBF1A411A7E00447C4C /* ElementAtPointInWebFrame.mm in Sources */, 4572 F4CF32802366552200D3AD07 /* EnterKeyHintTests.mm in Sources */, 4569 4573 07492B3B1DF8B14C00633DE1 /* EnumerateMediaDevices.cpp in Sources */, 4570 4574 448D7E471EA6C55500ECC756 /* EnvironmentUtilitiesTest.cpp in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.