Changeset 257740 in webkit


Ignore:
Timestamp:
Mar 2, 2020 2:50:52 PM (4 years ago)
Author:
Megan Gardner
Message:

Add date/time style to macCatalyst
https://bugs.webkit.org/show_bug.cgi?id=208456

Reviewed by Wenson Hsieh.

Source/WebKit:

Add style flag for date/time pickers on macCatalyst.

  • Platform/spi/ios/UIKitSPI.h:
  • UIProcess/ios/forms/WKFormInputControl.mm:

(-[WKDateTimePicker datePickerStyle]):
(-[WKDateTimePicker initWithView:datePickerMode:]):

Source/WTF:

  • wtf/PlatformHave.h:
Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r257721 r257740  
     12020-03-02  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Add date/time style to macCatalyst
     4        https://bugs.webkit.org/show_bug.cgi?id=208456
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        * wtf/PlatformHave.h:
     9
    1102020-03-02  Paulo Matos  <pmatos@igalia.com>
    211
  • trunk/Source/WTF/wtf/PlatformHave.h

    r257304 r257740  
    480480#define HAVE_HOVER_GESTURE_RECOGNIZER 1
    481481#define HAVE_LOOKUP_GESTURE_RECOGNIZER 1
     482#define HAVE_UIDATEPICKER_STYLE 1
    482483#endif
    483484
  • trunk/Source/WebKit/ChangeLog

    r257730 r257740  
     12020-03-02  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Add date/time style to macCatalyst
     4        https://bugs.webkit.org/show_bug.cgi?id=208456
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Add style flag for date/time pickers on macCatalyst.
     9
     10        * Platform/spi/ios/UIKitSPI.h:
     11        * UIProcess/ios/forms/WKFormInputControl.mm:
     12        (-[WKDateTimePicker datePickerStyle]):
     13        (-[WKDateTimePicker initWithView:datePickerMode:]):
     14
    1152020-03-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
    216
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r256634 r257740  
    190190};
    191191
     192#if HAVE(UIDATEPICKER_STYLE)
     193typedef NS_ENUM(NSInteger, UIDatePickerStyle) {
     194    UIDatePickerStyleAutomatic = 0
     195}
     196#endif
     197
    192198@interface UIDatePicker ()
    193199@property (nonatomic, readonly, getter=_contentWidth) CGFloat contentWidth;
     200#if HAVE(UIDATEPICKER_STYLE)
     201@property (nonatomic, readwrite, assign) UIDatePickerStyle preferredDatePickerStyle;
     202#endif
    194203@end
    195204
  • trunk/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm

    r253661 r257740  
    6969@end
    7070
     71#if USE(APPLE_INTERNAL_SDK)
     72#import <WebKitAdditions/WKFormInputControlAdditions.mm>
     73#endif
     74
    7175@implementation WKDateTimePicker
    7276
     
    8084    return _datePicker.get();
    8185}
     86
     87#if !USE(APPLE_INTERNAL_SDK) && HAVE(UIDATEPICKER_STYLE)
     88- (UIDatePickerStyle)datePickerStyle
     89{
     90    return UIDatePickerStyleAutomatic;
     91}
     92#endif
    8293
    8394- (id)initWithView:(WKContentView *)view datePickerMode:(UIDatePickerMode)mode
     
    110121
    111122    _datePicker = adoptNS([[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)]);
     123#if HAVE(UIDATEPICKER_STYLE)
     124    [_datePicker setPreferredDatePickerStyle:[self datePickerStyle]];
     125#endif
    112126    _datePicker.get().datePickerMode = mode;
    113127    _datePicker.get().hidden = NO;
Note: See TracChangeset for help on using the changeset viewer.