Changeset 278815 in webkit


Ignore:
Timestamp:
Jun 12, 2021, 2:45:31 PM (4 years ago)
Author:
Wenson Hsieh
Message:

Number pad button is missing its image when tapping on <input type=tel> in watchOS 8
https://bugs.webkit.org/show_bug.cgi?id=226955

Reviewed by Darin Adler.

Source/WebKit:

After some recent PepperUICore changes, the Quickboard button for presenting the number pad when focusing a
telephone input on watchOS 8 is missing its icon image. To fix this, stop using deprecated SPI for creating
the list tray button, and instead use +[PUICQuickboardListTrayButton buttonWithType:] and -setAction: to
create and set up the button.

  • Platform/spi/watchos/PepperUICoreSPI.h:
  • UIProcess/ios/forms/WKTextInputListViewController.mm:

(-[WKTextInputListViewController additionalTrayButtons]):

Source/WTF:

Add compile-time flags to guard the presence of PUICQuickboardController and PUICButtonTypePill.

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r278803 r278815  
     12021-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Number pad button is missing its image when tapping on <input type=tel> in watchOS 8
     4        https://bugs.webkit.org/show_bug.cgi?id=226955
     5
     6        Reviewed by Darin Adler.
     7
     8        Add compile-time flags to guard the presence of `PUICQuickboardController` and `PUICButtonTypePill`.
     9
     10        * wtf/PlatformHave.h:
     11
    1122021-06-11  Ryosuke Niwa  <rniwa@webkit.org>
    213
  • trunk/Source/WTF/wtf/PlatformHave.h

    r278780 r278815  
    946946#endif
    947947
     948#if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 80000
     949#define HAVE_QUICKBOARD_CONTROLLER 1
     950#define HAVE_PUIC_BUTTON_TYPE_PILL 1
     951#endif
     952
    948953#if PLATFORM(COCOA)
    949954#define HAVE_CORE_GRAPHICS_ADOBE_RGB_1998_COLOR_SPACE 1
  • trunk/Source/WebKit/ChangeLog

    r278811 r278815  
     12021-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Number pad button is missing its image when tapping on <input type=tel> in watchOS 8
     4        https://bugs.webkit.org/show_bug.cgi?id=226955
     5
     6        Reviewed by Darin Adler.
     7
     8        After some recent PepperUICore changes, the Quickboard button for presenting the number pad when focusing a
     9        telephone input on watchOS 8 is missing its icon image. To fix this, stop using deprecated SPI for creating
     10        the list tray button, and instead use `+[PUICQuickboardListTrayButton buttonWithType:]` and `-setAction:` to
     11        create and set up the button.
     12
     13        * Platform/spi/watchos/PepperUICoreSPI.h:
     14        * UIProcess/ios/forms/WKTextInputListViewController.mm:
     15        (-[WKTextInputListViewController additionalTrayButtons]):
     16
    1172021-06-12  Peng Liu  <peng.liu6@apple.com>
    218
  • trunk/Source/WebKit/Platform/spi/watchos/PepperUICoreSPI.h

    r272669 r278815  
    139139@end
    140140
     141typedef NS_ENUM(NSUInteger, PUICQuickboardAction) {
     142    PUICQuickboardActionAddNumber = 7,
     143};
     144
     145#if HAVE(PUIC_BUTTON_TYPE_PILL)
     146extern UIButtonType const PUICButtonTypePill;
     147#endif
     148
    141149@interface PUICQuickboardListTrayButton : PUICButton
    142150- (instancetype)initWithFrame:(CGRect)frame tintColor:(nullable UIColor *)tintColor defaultHeight:(CGFloat)defaultHeight;
     151@property (nonatomic) PUICQuickboardAction action;
    143152@end
    144153
  • trunk/Source/WebKit/UIProcess/ios/forms/WKTextInputListViewController.mm

    r273062 r278815  
    6565        return @[ ];
    6666
    67     UIImage *numberPadButtonIcon = [PUICResources imageNamed:@"QuickboardAddPhoneNumber" inBundle:[NSBundle bundleWithIdentifier:@"com.apple.PepperUICore"] shouldCache:YES];
    68 
     67#if HAVE(PUIC_BUTTON_TYPE_PILL)
     68    auto numberPadButton = retainPtr([PUICQuickboardListTrayButton buttonWithType:PUICButtonTypePill]);
     69#else
    6970    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
    7071    auto numberPadButton = adoptNS([[PUICQuickboardListTrayButton alloc] initWithFrame:CGRectZero tintColor:nil defaultHeight:self.specs.defaultButtonHeight]);
    7172    ALLOW_DEPRECATED_DECLARATIONS_END
    72     [numberPadButton setImage:numberPadButtonIcon forState:UIControlStateNormal];
     73#endif
     74    [numberPadButton setAction:PUICQuickboardActionAddNumber];
    7375    [numberPadButton addTarget:self action:@selector(presentNumberPadViewController) forControlEvents:UIControlEventTouchUpInside];
    7476    return @[ numberPadButton.get() ];
Note: See TracChangeset for help on using the changeset viewer.