Changeset 275532 in webkit


Ignore:
Timestamp:
Apr 6, 2021 10:54:10 AM (3 years ago)
Author:
Aditya Keerthi
Message:

[iOS] Prevent background blur when presenting date/time pickers
https://bugs.webkit.org/show_bug.cgi?id=224189
<rdar://problem/76220352>

Reviewed by Wenson Hsieh.

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

(-[WKDateTimePicker _contextMenuInteraction:styleForMenuWithConfiguration:]):

Presenting a UIContextMenuInteraction results in the application of a
blur effect to the background view. However, the peripheral presented
when interacting with a UIDatePicker across the rest of the system
does not blur the background.

To align our behavior with the rest of the system, remove the blur
effect by specifying an empty UIVisualEffect for the
_UIContextMenuStyle's preferredBackgroundEffects. The empty effect
must be explicitly specified, since setting an empty array will result
in the default effect being applied.

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r275531 r275532  
     12021-04-06  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        [iOS] Prevent background blur when presenting date/time pickers
     4        https://bugs.webkit.org/show_bug.cgi?id=224189
     5        <rdar://problem/76220352>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        * Platform/spi/ios/UIKitSPI.h:
     10        * UIProcess/ios/forms/WKDateTimeInputControl.mm:
     11        (-[WKDateTimePicker _contextMenuInteraction:styleForMenuWithConfiguration:]):
     12
     13        Presenting a UIContextMenuInteraction results in the application of a
     14        blur effect to the background view. However, the peripheral presented
     15        when interacting with a UIDatePicker across the rest of the system
     16        does not blur the background.
     17
     18        To align our behavior with the rest of the system, remove the blur
     19        effect by specifying an empty UIVisualEffect for the
     20        _UIContextMenuStyle's preferredBackgroundEffects. The empty effect
     21        must be explicitly specified, since setting an empty array will result
     22        in the default effect being applied.
     23
    1242021-04-06  Alex Christensen  <achristensen@webkit.org>
    225
  • trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h

    r273190 r275532  
    12141214@property (nonatomic) _UIContextMenuLayout preferredLayout;
    12151215@property (nonatomic) BOOL hasInteractivePreview;
     1216@property (nonatomic, strong) NSArray *preferredBackgroundEffects;
    12161217+ (instancetype)defaultStyle;
    12171218@end
  • trunk/Source/WebKit/UIProcess/ios/forms/WKDateTimeInputControl.mm

    r275520 r275532  
    164164    _UIContextMenuStyle *style = [_UIContextMenuStyle defaultStyle];
    165165    style.hasInteractivePreview = YES;
     166    style.preferredBackgroundEffects = @[ [UIVisualEffect emptyEffect] ];
    166167    style.preferredLayout = _UIContextMenuLayoutAutomatic;
    167168    return style;
Note: See TracChangeset for help on using the changeset viewer.