Changeset 204525 in webkit
- Timestamp:
- Aug 16, 2016, 3:15:47 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r204523 r204525 1 2016-08-16 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test iOS select elements, and add iPhone and iPad tests for them 4 https://bugs.webkit.org/show_bug.cgi?id=160909 5 6 Reviewed by Enrica Casucci. 7 8 Add iPhone and iPad tests for the <select> pickers. The iPhone test has to 9 use a didShowKeyboardCallback to know when to select the appropriate row, 10 and to dismiss the picker. The iPad test can just select the row, which also 11 dismisses the popover. 12 13 * fast/forms/ios/choose-select-option-expected.txt: Added. 14 * fast/forms/ios/choose-select-option.html: Added. 15 * fast/forms/ios/ipad/choose-select-option-expected.txt: Added. 16 * fast/forms/ios/ipad/choose-select-option.html: Added. 17 1 18 2016-08-15 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebKit2/ChangeLog
r204524 r204525 1 2016-08-16 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test iOS select elements, and add iPhone and iPad tests for them 4 https://bugs.webkit.org/show_bug.cgi?id=160909 5 6 Reviewed by Enrica Casucci. 7 8 Hook up form-related UIScriptController functions, and plumb through the various 9 <select> pickers the ability to select a row. 10 11 * UIProcess/API/Cocoa/WKWebView.mm: 12 (-[WKWebView dismissFormAccessoryView]): 13 (-[WKWebView selectFormAccessoryPickerRow:]): 14 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 15 * UIProcess/ios/WKContentViewInteraction.h: 16 * UIProcess/ios/WKContentViewInteraction.mm: 17 (-[WKContentView selectFormAccessoryPickerRow:]): 18 * UIProcess/ios/forms/WKFormSelectControl.h: 19 * UIProcess/ios/forms/WKFormSelectControl.mm: 20 (-[WKFormSelectControl selectRow:inComponent:extendingSelection:]): 21 * UIProcess/ios/forms/WKFormSelectPicker.mm: 22 (-[WKMultipleSelectPicker selectRow:inComponent:extendingSelection:]): 23 (-[WKSelectSinglePicker selectRow:inComponent:extendingSelection:]): 24 * UIProcess/ios/forms/WKFormSelectPopover.mm: 25 (-[WKSelectPopover selectRow:inComponent:extendingSelection:]): 26 1 27 2016-08-16 Brady Eidson <beidson@apple.com> 2 28 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r204523 r204525 4518 4518 } 4519 4519 4520 - (void)dismissFormAccessoryView 4521 { 4522 [_contentView accessoryDone]; 4523 } 4524 4525 - (void)selectFormAccessoryPickerRow:(int)rowIndex 4526 { 4527 [_contentView selectFormAccessoryPickerRow:rowIndex]; 4528 } 4529 4520 4530 #endif // PLATFORM(IOS) 4521 4531 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r204523 r204525 255 255 256 256 #if TARGET_OS_IPHONE 257 257 258 @property (nonatomic, readonly) CGRect _contentVisibleRect WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 258 259 - (CGPoint)_convertPointFromContentsToView:(CGPoint)point WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); … … 261 262 - (void)keyboardAccessoryBarNext WK_API_AVAILABLE(ios(WK_IOS_TBA)); 262 263 - (void)keyboardAccessoryBarPrevious WK_API_AVAILABLE(ios(WK_IOS_TBA)); 264 - (void)dismissFormAccessoryView WK_API_AVAILABLE(ios(WK_IOS_TBA)); 265 - (void)selectFormAccessoryPickerRow:(int)rowIndex WK_API_AVAILABLE(ios(WK_IOS_TBA)); 266 263 267 #endif 264 268 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r204523 r204525 224 224 @end 225 225 226 @interface WKContentView (WKTesting) 227 228 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex; 229 230 @end 231 226 232 #if HAVE(LINK_PREVIEW) 227 233 @interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate> -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r204523 r204525 3798 3798 @end 3799 3799 3800 @implementation WKContentView (WKTesting) 3801 3802 - (void)selectFormAccessoryPickerRow:(NSInteger)rowIndex 3803 { 3804 if ([_inputPeripheral isKindOfClass:[WKFormSelectControl self]]) 3805 [(WKFormSelectControl *)_inputPeripheral selectRow:rowIndex inComponent:0 extendingSelection:NO]; 3806 } 3807 3808 @end 3809 3800 3810 #if HAVE(LINK_PREVIEW) 3801 3811 … … 4109 4119 @end 4110 4120 4111 #endif 4121 #endif // HAVE(LINK_PREVIEW) 4112 4122 4113 4123 // UITextRange, UITextPosition and UITextSelectionRect implementations for WK2 -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h
r199960 r204525 40 40 @end 41 41 42 @interface WKFormSelectControl(WKTesting) 43 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection; 44 @end 45 42 46 @interface WKSelectPopover : WKFormRotatingAccessoryPopover<WKFormControl> 43 47 - (instancetype)initWithView:(WKContentView *)view hasGroups:(BOOL)hasGroups; … … 53 57 @end 54 58 59 @protocol WKSelectTesting 60 @optional 61 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection; 62 @end 63 55 64 #endif // PLATFORM(IOS) 56 65 -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.mm
r199960 r204525 59 59 60 60 @implementation WKFormSelectControl { 61 RetainPtr< id<WKFormControl>> _control;61 RetainPtr<NSObject<WKFormControl>> _control; 62 62 } 63 63 … … 102 102 @end 103 103 104 @implementation WKFormSelectControl(WKTesting) 105 106 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection 107 { 108 if ([_control respondsToSelector:@selector(selectRow:inComponent:extendingSelection:)]) 109 [id<WKSelectTesting>(_control.get()) selectRow:rowIndex inComponent:componentIndex extendingSelection:extendingSelection]; 110 } 111 112 @end 113 104 114 #endif // PLATFORM(IOS) -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPicker.mm
r204466 r204525 304 304 } 305 305 306 // WKSelectTesting 307 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection 308 { 309 // FIXME: handle extendingSelection. 310 [self selectRow:rowIndex inComponent:0 animated:NO]; 311 // Progammatic selection changes don't call the delegate, so do that manually. 312 [self.delegate pickerView:self didSelectRow:rowIndex inComponent:0]; 313 } 314 306 315 @end 307 316 … … 431 440 } 432 441 442 // WKSelectTesting 443 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection 444 { 445 // FIXME: handle extendingSelection. 446 [self selectRow:rowIndex inComponent:0 animated:NO]; 447 // Progammatic selection changes don't call the delegate, so do that manually. 448 [self.delegate pickerView:self didSelectRow:rowIndex inComponent:0]; 449 } 450 433 451 @end 434 452 -
trunk/Source/WebKit2/UIProcess/ios/forms/WKFormSelectPopover.mm
r200910 r204525 449 449 @end 450 450 451 @implementation WKSelectPopover(WKTesting) 452 453 - (void)selectRow:(NSInteger)rowIndex inComponent:(NSInteger)componentIndex extendingSelection:(BOOL)extendingSelection 454 { 455 NSIndexPath *indexPath = [NSIndexPath indexPathForRow:rowIndex inSection:componentIndex]; 456 [[_tableViewController tableView] selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionMiddle]; 457 // Inform the delegate, since -selectRowAtIndexPath:... doesn't do that. 458 [_tableViewController tableView:[_tableViewController tableView] didSelectRowAtIndexPath:indexPath]; 459 } 460 461 @end 462 451 463 #endif // PLATFORM(IOS) -
trunk/Tools/ChangeLog
r204523 r204525 1 2016-08-16 Simon Fraser <simon.fraser@apple.com> 2 3 Make it possible to test iOS select elements, and add iPhone and iPad tests for them 4 https://bugs.webkit.org/show_bug.cgi?id=160909 5 6 Reviewed by Enrica Casucci. 7 8 Add functions to UIScriptController to dismiss the form accessory view for iOS, 9 and to programmatically pick a row from a <select> picker. 10 11 * WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl: 12 * WebKitTestRunner/UIScriptContext/UIScriptController.cpp: 13 (WTR::UIScriptController::dismissFormAccessoryView): 14 (WTR::UIScriptController::selectFormAccessoryPickerRow): 15 * WebKitTestRunner/UIScriptContext/UIScriptController.h: 16 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 17 (WTR::UIScriptController::dismissFormAccessoryView): 18 (WTR::UIScriptController::selectFormAccessoryPickerRow): 19 1 20 2016-08-15 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl
r204523 r204525 43 43 void keyUpUsingHardwareKeyboard(DOMString character, object callback); 44 44 45 // Equivalent of pressing the Done button in the form accessory bar. 46 void dismissFormAccessoryView(); 47 48 // <select> picker 49 void selectFormAccessoryPickerRow(long rowIndex); 50 45 51 void keyboardAccessoryBarNext(); 46 52 void keyboardAccessoryBarPrevious(); 47 53 54 // These callbacks also work for the form accessory views. 48 55 attribute object didShowKeyboardCallback; 49 56 attribute object didHideKeyboardCallback; -
trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp
r204523 r204525 151 151 } 152 152 153 void UIScriptController::dismissFormAccessoryView() 154 { 155 } 156 157 void UIScriptController::selectFormAccessoryPickerRow(long) 158 { 159 } 160 153 161 void UIScriptController::keyboardAccessoryBarNext() 154 162 { -
trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h
r204523 r204525 60 60 void keyboardAccessoryBarNext(); 61 61 void keyboardAccessoryBarPrevious(); 62 63 void dismissFormAccessoryView(); 64 void selectFormAccessoryPickerRow(long); 62 65 63 66 void setWillBeginZoomingCallback(JSValueRef); -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r204523 r204525 176 176 } 177 177 178 void UIScriptController::dismissFormAccessoryView() 179 { 180 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 181 [webView dismissFormAccessoryView]; 182 } 183 184 void UIScriptController::selectFormAccessoryPickerRow(long rowIndex) 185 { 186 TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); 187 [webView selectFormAccessoryPickerRow:rowIndex]; 188 } 189 178 190 void UIScriptController::keyboardAccessoryBarNext() 179 191 {
Note:
See TracChangeset
for help on using the changeset viewer.