Changeset 228557 in webkit
- Timestamp:
- Feb 16, 2018 6:35:49 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r228553 r228557 1 2018-02-16 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] Add basic support for <input type='date'> using date picker UI 4 https://bugs.webkit.org/show_bug.cgi?id=182847 5 <rdar://problem/35143111> 6 7 Reviewed by Tim Horton. 8 9 Add new localized strings for "month", "day" and "year" as they appear in the date picker. 10 11 * English.lproj/Localizable.strings: 12 * platform/LocalizedStrings.cpp: 13 (WebCore::textInputModeWriteButtonTitle): 14 (WebCore::textInputModeSpeechButtonTitle): 15 (WebCore::datePickerDayLabelTitle): 16 (WebCore::datePickerMonthLabelTitle): 17 (WebCore::datePickerYearLabelTitle): 18 (WebCore::textInputModeWriteButton): Deleted. 19 (WebCore::textInputModeSpeechButton): Deleted. 20 * platform/LocalizedStrings.h: 21 1 22 2018-02-16 Zan Dobersek <zdobersek@igalia.com> 2 23 -
trunk/Source/WebCore/English.lproj/Localizable.strings
r228121 r228557 212 212 "Cut (Undo action name)" = "Cut"; 213 213 214 /* Day label in date picker */ 215 "Day label in date picker" = "Day"; 216 214 217 /* Default writing direction context menu item */ 215 218 "Default" = "Default"; … … 410 413 "Missing Plug-in" = "Missing Plug-in"; 411 414 415 /* Month label in date picker */ 416 "Month label in date picker" = "Month"; 417 412 418 /* Media Mute context menu item */ 413 419 "Mute" = "Mute"; … … 818 824 "Write" = "Write"; 819 825 826 /* Year label in date picker */ 827 "Year label in date picker" = "Year"; 828 820 829 /* message in authentication panel */ 821 830 "Your login information will be sent securely." = "Your login information will be sent securely."; -
trunk/Source/WebCore/platform/LocalizedStrings.cpp
r228121 r228557 1057 1057 } 1058 1058 1059 String textInputModeWriteButton ()1059 String textInputModeWriteButtonTitle() 1060 1060 { 1061 1061 return WEB_UI_STRING("Write", "Title of the writing button for zoomed form controls."); 1062 1062 } 1063 1063 1064 String textInputModeSpeechButton ()1064 String textInputModeSpeechButtonTitle() 1065 1065 { 1066 1066 return WEB_UI_STRING("Speak", "Title of the dictation button for zoomed form controls."); 1067 1067 } 1068 1068 1069 String datePickerDayLabelTitle() 1070 { 1071 return WEB_UI_STRING("Day label in date picker", "Day label in date picker"); 1072 } 1073 1074 String datePickerMonthLabelTitle() 1075 { 1076 return WEB_UI_STRING("Month label in date picker", "Month label in date picker"); 1077 } 1078 1079 String datePickerYearLabelTitle() 1080 { 1081 return WEB_UI_STRING("Year label in date picker", "Year label in date picker"); 1082 } 1083 1069 1084 #endif 1070 1085 -
trunk/Source/WebCore/platform/LocalizedStrings.h
r228121 r228557 322 322 WEBCORE_EXPORT String formControlGoButtonTitle(); 323 323 WEBCORE_EXPORT String formControlSearchButtonTitle(); 324 WEBCORE_EXPORT String textInputModeWriteButton(); 325 WEBCORE_EXPORT String textInputModeSpeechButton(); 324 WEBCORE_EXPORT String textInputModeWriteButtonTitle(); 325 WEBCORE_EXPORT String textInputModeSpeechButtonTitle(); 326 WEBCORE_EXPORT String datePickerDayLabelTitle(); 327 WEBCORE_EXPORT String datePickerMonthLabelTitle(); 328 WEBCORE_EXPORT String datePickerYearLabelTitle(); 326 329 #endif 327 330 -
trunk/Source/WebKit/ChangeLog
r228551 r228557 1 2018-02-16 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] Add basic support for <input type='date'> using date picker UI 4 https://bugs.webkit.org/show_bug.cgi?id=182847 5 <rdar://problem/35143111> 6 7 Reviewed by Tim Horton. 8 9 Add support for presenting date pickers when focusing a date input. 10 11 * UIProcess/ios/WKContentViewInteraction.h: 12 * UIProcess/ios/WKContentViewInteraction.mm: 13 (-[WKContentView _stopAssistingNode]): 14 (-[WKContentView dismissAllInputViewControllers]): 15 16 Pull logic to dismiss input view controllers into a single helper. 17 18 (-[WKContentView presentDatePickerViewController:]): 19 (-[WKContentView dismissDatePickerViewController:]): 20 (-[WKContentView presentViewControllerForAssistedNode:]): 21 (-[WKContentView textInputController:didCommitText:]): 22 (-[WKContentView _wheelChangedWithEvent:]): 23 24 Delegate wheel events to the date picker. 25 26 * UIProcess/ios/forms/WKDatePickerViewController.h: Added. 27 * UIProcess/ios/forms/WKDatePickerViewController.mm: Added. 28 29 Add harness files for the WKDatePickerViewController implementation in WebKitAdditions. 30 31 * WebKit.xcodeproj/project.pbxproj: 32 1 33 2018-02-15 Youenn Fablet <youenn@apple.com> 2 34 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r228393 r228557 85 85 86 86 #if ENABLE(EXTRA_ZOOM_MODE) 87 @class WKDatePickerViewController; 87 88 @class WKFocusedFormControlViewController; 88 89 @class WKNumberPadViewController; … … 247 248 248 249 #if ENABLE(EXTRA_ZOOM_MODE) 250 RetainPtr<WKDatePickerViewController> _datePickerViewController; 249 251 RetainPtr<WKTextInputViewController> _textInputViewController; 250 252 RetainPtr<WKFocusedFormControlViewController> _focusedFormControlViewController; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r228549 r228557 41 41 #import "UIKitSPI.h" 42 42 #import "WKActionSheetAssistant.h" 43 #import "WKDatePickerViewController.h" 43 44 #import "WKError.h" 44 45 #import "WKFocusedFormControlViewController.h" … … 4089 4090 4090 4091 #if ENABLE(EXTRA_ZOOM_MODE) 4092 [self dismissAllInputViewControllers]; 4093 if (!_isChangingFocus) 4094 [self dismissFocusedFormControlViewController:[_focusedFormControlViewController isVisible]]; 4095 #endif 4096 4097 // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects. 4098 if (editableChanged) 4099 [_webView _scheduleVisibleContentRectUpdate]; 4100 4101 [_webView didEndFormControlInteraction]; 4102 } 4103 4104 #if ENABLE(EXTRA_ZOOM_MODE) 4105 4106 - (void)dismissAllInputViewControllers 4107 { 4091 4108 [self dismissTextInputViewController:YES]; 4092 4109 [self dismissNumberPadViewController:YES]; 4093 4110 [self dismissSelectMenuViewController:YES]; 4094 4111 [self dismissTimePickerViewController:YES]; 4095 if (!_isChangingFocus) 4096 [self dismissFocusedFormControlViewController:[_focusedFormControlViewController isVisible]]; 4097 #endif 4098 4099 // The custom fixed position rect behavior is affected by -isAssistingNode, so if that changes we need to recompute rects. 4100 if (editableChanged) 4101 [_webView _scheduleVisibleContentRectUpdate]; 4102 4103 [_webView didEndFormControlInteraction]; 4104 } 4105 4106 #if ENABLE(EXTRA_ZOOM_MODE) 4112 [self dismissDatePickerViewController:YES]; 4113 } 4114 4115 - (void)presentDatePickerViewController:(BOOL)animated 4116 { 4117 if (_datePickerViewController) 4118 return; 4119 4120 _datePickerViewController = adoptNS([[WKDatePickerViewController alloc] initWithText:_assistedNodeInformation.value textSuggestions:@[ ]]); 4121 [_datePickerViewController setDelegate:self]; 4122 [_focusedFormControlViewController presentViewController:_datePickerViewController.get() animated:animated completion:nil]; 4123 } 4124 4125 - (void)dismissDatePickerViewController:(BOOL)animated 4126 { 4127 if (!_datePickerViewController) 4128 return; 4129 4130 auto datePickerViewController = WTFMove(_datePickerViewController); 4131 [datePickerViewController dismissViewControllerAnimated:animated completion:nil]; 4132 } 4107 4133 4108 4134 - (void)presentTimePickerViewController:(BOOL)animated … … 4196 4222 [self presentTimePickerViewController:YES]; 4197 4223 break; 4224 case InputType::Date: 4225 [self presentDatePickerViewController:YES]; 4226 break; 4198 4227 case InputType::None: 4199 4228 break; … … 4236 4265 4237 4266 [_focusedFormControlViewController show:NO]; 4238 [self dismissTextInputViewController:YES]; 4239 [self dismissNumberPadViewController:YES]; 4240 [self dismissTimePickerViewController:YES]; 4267 [self dismissAllInputViewControllers]; 4241 4268 } 4242 4269 … … 4397 4424 4398 4425 if ([_timePickerViewController handleWheelEvent:event]) 4426 return; 4427 4428 if ([_datePickerViewController handleWheelEvent:event]) 4399 4429 return; 4400 4430 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r228523 r228557 737 737 2E5C770F1FA7D429005932C3 /* APIAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E5C770D1FA7D429005932C3 /* APIAttachment.cpp */; }; 738 738 2E7A944A1BBD97C300945547 /* _WKFocusedElementInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; 739 2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */; }; 740 2E94FC1720351A6D00974BA0 /* WKDatePickerViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */; }; 739 741 2EA7B3D12026CEF8009CE5AC /* WKNumberPadViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EA7B3CF2026CEF8009CE5AC /* WKNumberPadViewController.h */; }; 740 742 2EA7B3D22026CEF8009CE5AC /* WKNumberPadViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EA7B3D02026CEF8009CE5AC /* WKNumberPadViewController.mm */; }; … … 3105 3107 2E5C770D1FA7D429005932C3 /* APIAttachment.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = APIAttachment.cpp; sourceTree = "<group>"; }; 3106 3108 2E7A94491BBD95C600945547 /* _WKFocusedElementInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKFocusedElementInfo.h; sourceTree = "<group>"; }; 3109 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKDatePickerViewController.h; path = ios/forms/WKDatePickerViewController.h; sourceTree = "<group>"; }; 3110 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKDatePickerViewController.mm; path = ios/forms/WKDatePickerViewController.mm; sourceTree = "<group>"; }; 3107 3111 2EA7B3CF2026CEF8009CE5AC /* WKNumberPadViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKNumberPadViewController.h; path = ios/forms/WKNumberPadViewController.h; sourceTree = "<group>"; }; 3108 3112 2EA7B3D02026CEF8009CE5AC /* WKNumberPadViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKNumberPadViewController.mm; path = ios/forms/WKNumberPadViewController.mm; sourceTree = "<group>"; }; … … 8384 8388 C5FA1ED118E1062200B3F402 /* WKAirPlayRoutePicker.h */, 8385 8389 C5FA1ED218E1062200B3F402 /* WKAirPlayRoutePicker.mm */, 8390 2E94FC1420351A6D00974BA0 /* WKDatePickerViewController.h */, 8391 2E94FC1520351A6D00974BA0 /* WKDatePickerViewController.mm */, 8386 8392 A58B6F0618FCA733008CBA53 /* WKFileUploadPanel.h */, 8387 8393 A58B6F0718FCA733008CBA53 /* WKFileUploadPanel.mm */, … … 9411 9417 37A709A71E3EA0FD00CA5969 /* WKDataDetectorTypes.h in Headers */, 9412 9418 37A709A91E3EA40C00CA5969 /* WKDataDetectorTypesInternal.h in Headers */, 9419 2E94FC1620351A6D00974BA0 /* WKDatePickerViewController.h in Headers */, 9413 9420 377EAD4517E2C51A002D193D /* WKDeclarationSpecifiers.h in Headers */, 9414 9421 8372DB2F1A677D4A00C697C5 /* WKDiagnosticLoggingResultType.h in Headers */, … … 11108 11115 512F58F912A88A5400629530 /* WKCredential.cpp in Sources */, 11109 11116 BC4075F7124FF0270068F20A /* WKData.cpp in Sources */, 11117 2E94FC1720351A6D00974BA0 /* WKDatePickerViewController.mm in Sources */, 11110 11118 1AFF49001833DE78009AB15A /* WKDeprecatedFunctions.cpp in Sources */, 11111 11119 BC4075F9124FF0270068F20A /* WKDictionary.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.