Bug 215619

Summary: [macOS] Move stepper painting code off of Carbon API
Product: WebKit Reporter: Aditya Keerthi <akeerthi>
Component: FormsAssignee: Aditya Keerthi <akeerthi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac   
OS: Other   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch none

Description Aditya Keerthi 2020-08-18 12:38:19 PDT
This will ensure the stepper has an appropriate appearance in dark mode.
Comment 1 Aditya Keerthi 2020-08-18 12:39:27 PDT
<rdar://problem/41936617>
Comment 2 Aditya Keerthi 2020-08-18 13:11:43 PDT
Created attachment 406802 [details]
Patch
Comment 3 Darin Adler 2020-08-18 13:55:37 PDT
Comment on attachment 406802 [details]
Patch

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

We should figure out how to make test coverage for this.

> Source/WebCore/platform/mac/ThemeMac.mm:637
> +    ControlStates::States states = controlStates.states();

Consider auto here instead of writing out the type ControlStates::States

> Source/WebCore/platform/mac/ThemeMac.mm:672
> +        (__bridge NSString *)kCUIWidgetKey: (__bridge NSString *)kCUIWidgetButtonLittleArrows,
> +        (__bridge NSString *)kCUISizeKey: coreUISize,
> +        (__bridge NSString *)kCUIStateKey: coreUIState,
> +        (__bridge NSString *)kCUIValueKey: (states & ControlStates::SpinUpState) ? @1 : @0,
> +        (__bridge NSString *)kCUIIsFlippedKey : @NO,
> +        (__bridge NSString *)kCUIScaleKey : @1,
> +        (__bridge NSString *)kCUIMaskOnlyKey : @NO

Mixed formatting here about whether the ":" has a space before it or not.
Comment 4 Aditya Keerthi 2020-08-18 15:06:32 PDT
Created attachment 406817 [details]
Patch for landing
Comment 5 Aditya Keerthi 2020-08-18 15:07:48 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 406802 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406802&action=review
> 
> We should figure out how to make test coverage for this.

I added a reference mismatch test to verify that the stepper has a different appearance under dark mode.
Comment 6 EWS 2020-08-19 09:03:39 PDT
Committed r265860: <https://trac.webkit.org/changeset/265860>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406817 [details].
Comment 7 Aditya Keerthi 2020-08-20 11:11:44 PDT
Reopening to attach new patch.
Comment 8 Aditya Keerthi 2020-08-20 11:11:45 PDT
Created attachment 406947 [details]
Patch
Comment 9 Aditya Keerthi 2020-08-20 11:13:49 PDT
Uploaded a patch to the wrong bug.