Update Sizes calculations for Date/Time form controls
Created attachment 395825 [details] Patch
Created attachment 395830 [details] Patch
<rdar://problem/60385475>
Created attachment 395831 [details] Patch
Comment on attachment 395831 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395831&action=review > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:120 > + _datePicker = adoptNS([[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]); Nit - this can just be adoptNS([[UIDatePicker alloc] init]);
Comment on attachment 395831 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395831&action=review > Source/WebKit/ChangeLog:3 > + Update Sizes calculations for Date/Time form controls This is not a great title because it doesn't describe the problem. The radar title is ... better, but not great. Something more descriptive of the problem (like "[iOS] Date and time form controls are presented at the wrong size in some modes") would be A++. > Source/WebKit/ChangeLog:10 > + Better calculations for sizes happen when we set the mode before calling > + sizeToFit. This is not a great description. I think the key is "defaultSizeForInterfaceOrientation is insufficient, we should let the UIDatePicker determine its own size given the configuration we're going to use" (but in different words) > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:120 > + _datePicker = adoptNS([[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]); CGRectZero is fine > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:130 > + [_datePicker setFrame:CGRectMake(0, 0, size.width, size.height)]; isn't setFrameSize a thing? Or is that only on NSView? > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:346 > + [_viewController setPreferredContentSize:datePicker.frame.size]; Is this OK for all modes?
(In reply to Tim Horton from comment #6) > Comment on attachment 395831 [details] > Patch > > > Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:120 > > + _datePicker = adoptNS([[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]); > > CGRectZero is fine Though wenson is also right.
Comment on attachment 395831 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395831&action=review >> Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:130 >> + [_datePicker setFrame:CGRectMake(0, 0, size.width, size.height)]; > > isn't setFrameSize a thing? Or is that only on NSView? AFAIK, this only exists as deprecated SPI on UIView (-setSize:).
Created attachment 395849 [details] Patch
Committed r259806: <https://trac.webkit.org/changeset/259806> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395849 [details].