[webkit-reviews] review granted: [Bug 232031] [macOS] Update appearance of <datalist> indicator : [Attachment 441923] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 21 09:27:45 PDT 2021


Wenson Hsieh <wenson_hsieh at apple.com> has granted Aditya Keerthi
<akeerthi at apple.com>'s request for review:
Bug 232031: [macOS] Update appearance of <datalist> indicator
https://bugs.webkit.org/show_bug.cgi?id=232031

Attachment 441923: Patch

https://bugs.webkit.org/attachment.cgi?id=441923&action=review




--- Comment #4 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 441923
  --> https://bugs.webkit.org/attachment.cgi?id=441923
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=441923&action=review

> Source/WebCore/rendering/RenderThemeMac.mm:1019
> +	   if (auto* buttonElement = input.dataListButtonElement())
> +	       coreUIState = (__bridge NSString *)(buttonElement->active() ?
kCUIStatePressed : kCUIStateActive);
> +	   else
> +	       coreUIState = (__bridge NSString *)kCUIStateActive;

Nit - might look cleaner with a top-level `else if` like:

```
if (input.isPresentingAttachedView())
    coreUIState = (__bridge NSString *)kCUIStatePressed;
else if (auto* buttonElement = input.dataListButtonElement())
    coreUIState = (__bridge NSString *)(buttonElement->active() ?
kCUIStatePressed : kCUIStateActive);
else
    coreUIState = (__bridge NSString *)kCUIStateActive;
```


More information about the webkit-reviews mailing list