Changeset 230941 in webkit
- Timestamp:
- Apr 23, 2018 7:45:32 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r230939 r230941 1 2018-04-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI 4 https://bugs.webkit.org/show_bug.cgi?id=184901 5 <rdar://problem/39664797> 6 7 Reviewed by Tim Horton. 8 9 Adds a basic test to verify that tapping on an input of type `time` and choosing a time actually changes the 10 value of the input. Also adds a new UIHelper function to set the value of the currently focused input of type 11 time to the given hours and minutes. 12 13 * fast/forms/extrazoom/time-picker-value-change-expected.txt: Added. 14 * fast/forms/extrazoom/time-picker-value-change.html: Added. 15 * resources/ui-helper.js: 16 (window.UIHelper.setTimePickerValue): 17 (window.UIHelper): 18 1 19 2018-04-23 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/LayoutTests/resources/ui-helper.js
r230860 r230941 194 194 return new Promise(resolve => testRunner.runUIScript(enterTextScript, resolve)); 195 195 } 196 197 static setTimePickerValue(hours, minutes) 198 { 199 const setValueScript = `(() => uiController.setTimePickerValue(${hours}, ${minutes}))()`; 200 return new Promise(resolve => testRunner.runUIScript(setValueScript, resolve)); 201 } 196 202 } -
trunk/Source/WebKit/ChangeLog
r230938 r230941 1 2018-04-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI 4 https://bugs.webkit.org/show_bug.cgi?id=184901 5 <rdar://problem/39664797> 6 7 Reviewed by Tim Horton. 8 9 Fixes the bug by falling back to setting the value of the focused input element in the case where the selection 10 is not editable. Also adds plumbing to make time pickers testable in extra zoom mode. 11 12 * UIProcess/API/Cocoa/WKWebView.mm: 13 (-[WKWebView setTimePickerValueToHour:minute:]): 14 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 15 * UIProcess/ios/WKContentViewInteraction.h: 16 * UIProcess/ios/WKContentViewInteraction.mm: 17 (-[WKContentView setTimePickerValueToHour:minute:]): 18 19 Add plumbing to make it possible for WebKitTestRunner to simulate picking a time from the given hours and 20 minutes. This is currently only implemented for extra zoom mode, but may be implemented for UIKit's time picker 21 as well in the future by adjusting -[WKContentView setTimePickerValueToHour:minute:]. 22 23 * WebProcess/WebPage/WebPage.cpp: 24 (WebKit::WebPage::setTextAsync): 25 1 26 2018-04-23 Saam Barati <sbarati@apple.com> 2 27 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r230884 r230941 5900 5900 } 5901 5901 5902 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute 5903 { 5904 [_contentView setTimePickerValueToHour:hour minute:minute]; 5905 } 5906 5902 5907 - (void)selectFormAccessoryPickerRow:(int)rowIndex 5903 5908 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r230868 r230941 383 383 - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(10.3)); 384 384 @property (nonatomic, readonly) NSString *selectFormPopoverTitle WK_API_AVAILABLE(ios(WK_IOS_TBA)); 385 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute WK_API_AVAILABLE(ios(WK_IOS_TBA)); 385 386 386 387 - (void)applyAutocorrection:(NSString *)newString toString:(NSString *)oldString withCompletionHandler:(void (^)(void))completionHandler WK_API_AVAILABLE(ios(11.0)); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r230860 r230941 362 362 - (void)_simulateTextEntered:(NSString *)text; 363 363 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex; 364 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute; 364 365 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem; 365 366 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r230902 r230941 5519 5519 } 5520 5520 5521 - (void)setTimePickerValueToHour:(NSInteger)hour minute:(NSInteger)minute 5522 { 5523 #if ENABLE(EXTRA_ZOOM_MODE) 5524 if ([_presentedFullScreenInputViewController isKindOfClass:[WKTimePickerViewController class]]) 5525 [(WKTimePickerViewController *)_presentedFullScreenInputViewController.get() setHour:hour minute:minute]; 5526 #endif 5527 } 5528 5521 5529 - (NSDictionary *)_contentsOfUserInterfaceItem:(NSString *)userInterfaceItem 5522 5530 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r230908 r230941 4609 4609 { 4610 4610 auto frame = makeRef(m_page->focusController().focusedOrMainFrame()); 4611 if (!frame->selection().selection().isContentEditable()) 4612 return; 4613 4614 UserTypingGestureIndicator indicator(frame.get()); 4615 frame->selection().selectAll(); 4616 frame->editor().insertText(text, nullptr, TextEventInputKeyboard); 4611 if (frame->selection().selection().isContentEditable()) { 4612 UserTypingGestureIndicator indicator(frame.get()); 4613 frame->selection().selectAll(); 4614 frame->editor().insertText(text, nullptr, TextEventInputKeyboard); 4615 return; 4616 } 4617 4618 if (is<HTMLInputElement>(m_assistedNode.get())) { 4619 downcast<HTMLInputElement>(*m_assistedNode).setValueForUser(text); 4620 return; 4621 } 4622 4623 ASSERT_NOT_REACHED(); 4617 4624 } 4618 4625 -
trunk/Tools/ChangeLog
r230931 r230941 1 2018-04-23 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [Extra zoom mode] REGRESSION(230860) Unable to change time input values using UI 4 https://bugs.webkit.org/show_bug.cgi?id=184901 5 <rdar://problem/39664797> 6 7 Reviewed by Tim Horton. 8 9 Introduce a new UIScriptController method to set the value of a currently focused input of type time, by 10 interacting with the UI. See WebKit ChangeLogs for more detail. 11 12 * DumpRenderTree/ios/UIScriptControllerIOS.mm: 13 (WTR::UIScriptController::setTimePickerValue): 14 * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: 15 * TestRunnerShared/UIScriptContext/UIScriptController.cpp: 16 (WTR::UIScriptController::setTimePickerValue): 17 * TestRunnerShared/UIScriptContext/UIScriptController.h: 18 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 19 (WTR::UIScriptController::setTimePickerValue): 20 1 21 2018-04-23 Zalan Bujtas <zalan@apple.com> 2 22 -
trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
r230860 r230941 160 160 } 161 161 162 void UIScriptController::setTimePickerValue(long, long) 163 { 164 } 165 162 166 void UIScriptController::selectFormAccessoryPickerRow(long rowIndex) 163 167 { -
trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
r230860 r230941 191 191 readonly attribute DOMString selectFormPopoverTitle; 192 192 193 void setTimePickerValue(long hour, long minute); 194 193 195 void keyboardAccessoryBarNext(); 194 196 void keyboardAccessoryBarPrevious(); -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
r230860 r230941 299 299 } 300 300 301 void UIScriptController::setTimePickerValue(long, long) 302 { 303 } 304 301 305 void UIScriptController::selectFormAccessoryPickerRow(long) 302 306 { -
trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
r230860 r230941 100 100 void selectFormAccessoryPickerRow(long); 101 101 JSRetainPtr<JSStringRef> selectFormPopoverTitle() const; 102 void setTimePickerValue(long hour, long minute); 102 103 103 104 JSObjectRef contentsOfUserInterfaceItem(JSStringRef) const; -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r230860 r230941 437 437 [webView selectFormAccessoryPickerRow:rowIndex]; 438 438 } 439 440 void UIScriptController::setTimePickerValue(long hour, long minute) 441 { 442 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 443 [webView setTimePickerValueToHour:hour minute:minute]; 444 } 439 445 440 446 JSObjectRef UIScriptController::contentsOfUserInterfaceItem(JSStringRef interfaceItem) const
Note: See TracChangeset
for help on using the changeset viewer.