RESOLVED FIXED 211825
Change Date/Time popovers to contextMenus.
https://bugs.webkit.org/show_bug.cgi?id=211825
Summary Change Date/Time popovers to contextMenus.
Megan Gardner
Reported 2020-05-12 18:56:32 PDT
Change Date/Time popovers to contextMenus.
Attachments
Patch (61.09 KB, patch)
2020-05-12 19:06 PDT, Megan Gardner
no flags
Patch (61.84 KB, patch)
2020-05-12 20:29 PDT, Megan Gardner
no flags
Patch (61.84 KB, patch)
2020-05-12 21:56 PDT, Megan Gardner
no flags
Patch (62.94 KB, patch)
2020-05-13 09:06 PDT, Megan Gardner
no flags
Patch (59.65 KB, patch)
2020-05-13 09:18 PDT, Megan Gardner
no flags
Patch for landing (59.72 KB, patch)
2020-05-13 14:34 PDT, Megan Gardner
no flags
Megan Gardner
Comment 1 2020-05-12 19:06:44 PDT
Megan Gardner
Comment 2 2020-05-12 20:29:43 PDT
Megan Gardner
Comment 3 2020-05-12 21:56:45 PDT
Wenson Hsieh
Comment 4 2020-05-13 08:03:00 PDT
Comment on attachment 399239 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399239&action=review > Source/WebKit/ChangeLog:9 > + Removed all the unneded popover code. Nit - unneeded > Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:104 > +@class WKDateTimeInputControl; Nit - let’s keep this sorted and move it above WKDrawingCoordinator. > Source/WebKit/UIProcess/ios/WKContentViewInteraction.h:542 > +- (NSString*)inputLabelText; Nit - space before * > Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:8628 > +- (WKDateTimeInputControl *)formInputControl Should we also rename `-formInputControl` to `-dateTimeInputControl`? > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:44 > +} > +- (id)init; Nit - no need for the { }, as well as the -init declaration. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:67 > +- (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode; Let’s use instancetype for the return value. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:87 > +- (id)init > +{ > + if (!(self = [super init])) > + return nil; > + return self; > +} Do we need to override this? > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:175 > + [_viewController setToolbarItems:@[ [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], [[UIBarButtonItem alloc] initWithTitle:resetString style:UIBarButtonItemStylePlain target:self action:@selector(reset:)] ]]; The two UIBarButtonItems leak here. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:182 > + UILabel *title = [[UILabel alloc] init]; The UILabel leaks here. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:187 > + _viewController.get().navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:title]; This leaks the UIBarButtonItem. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:432 > + RetainPtr<NSObject <WKFormControl>> control; > + control = adoptNS([[WKDateTimePicker alloc] initWithView:view datePickerMode:mode]); Nit - I think you can just return [super initWithView:view control:adoptNS([[WKDateTimePicker alloc] initWithView:view datePickerMode:mode])];
Wenson Hsieh
Comment 5 2020-05-13 08:07:09 PDT
Comment on attachment 399239 [details] Patch r=me, with fixes for the memory leaks and style nits
Wenson Hsieh
Comment 6 2020-05-13 08:13:41 PDT
Comment on attachment 399239 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=399239&action=review It’s also probably worth running the tests in fast/forms/ios to make sure this doesn’t break any testing infrastructure. > Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm:58 > + WKContentView* _view; Nit - space before the *
Megan Gardner
Comment 7 2020-05-13 09:06:58 PDT
Megan Gardner
Comment 8 2020-05-13 09:18:37 PDT
Megan Gardner
Comment 9 2020-05-13 13:56:47 PDT
Megan Gardner
Comment 10 2020-05-13 14:34:22 PDT
Created attachment 399301 [details] Patch for landing
EWS
Comment 11 2020-05-13 14:54:55 PDT
Committed r261658: <https://trac.webkit.org/changeset/261658> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399301 [details].
Note You need to log in before you can comment on or make changes to this bug.