[webkit-reviews] review granted: [Bug 210613] Date and Time form controls not showing correct initial values on immediate second invocation. : [Attachment 396817] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Apr 17 17:26:20 PDT 2020
Wenson Hsieh <wenson_hsieh at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 210613: Date and Time form controls not showing correct initial values on
immediate second invocation.
https://bugs.webkit.org/show_bug.cgi?id=210613
Attachment 396817: Patch
https://bugs.webkit.org/attachment.cgi?id=396817&action=review
--- Comment #2 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 396817
--> https://bugs.webkit.org/attachment.cgi?id=396817
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=396817&action=review
> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:4325
> +- (void)updateValueAsNumberForViewController:(double)value
Nit - the “ForViewController:" suffix makes it sound like the argument should
be a `UIViewController *`, but instead it’s a value.
What about naming these -updateFocusedElementValueAsNumber: and
-updateFocusedElementValue: instead?
> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:8488
> +#elif PLATFORM(IOS)
This excludes Mac Catalyst — is that intentional?
> Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:153
> + NSDateComponents *components = [calendar components:(NSCalendarUnitHour)
fromDate:[_datePicker date]];
Nit - don’t need () around NSCalendarUnitMinute.
> Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:161
> + NSDateComponents *components = [calendar
components:(NSCalendarUnitMinute) fromDate:[_datePicker date]];
Nit - ditto regarding the ().
> Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:280
> + date = [[self dateFormatterForPicker] dateFromString:timeString];
Nit - I don’t think the date local variable adds much value here, but if you
prefer to include it, I’d move this down so that it’s just:
NSDate *date = [[self dateFormatterForPicker] dateFromString:timeString];
> Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm:328
> + if ([self.control isKindOfClass:WKDateTimePopover.class])
Nit - WKDateTimePopover and WKDateTimePicker are not subclasses of each other,
so you don’t need the return statements here.
More information about the webkit-reviews
mailing list