Bug 231160

Summary: Add an alternate style for form controls, and implement it for checkboxes and radio buttons
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: akeerthi, changseok, dino, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch sam: review+

Description Tim Horton 2021-10-04 02:38:30 PDT
Add an alternate filled style for form controls on iOS
Comment 1 Tim Horton 2021-10-04 02:39:03 PDT
Created attachment 440043 [details]
Patch
Comment 2 Aditya Keerthi 2021-10-04 10:11:47 PDT
Comment on attachment 440043 [details]
Patch

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

> Source/WebCore/rendering/RenderThemeIOS.mm:2094
> +        return nil;

`nullptr`?

> Source/WebCore/rendering/RenderThemeIOS.mm:2123
> +    context.setFillGradient(*checkboxRadioBackgroundGradient(roundedRect.rect(), states));

This will result in a null deference in the pressed state.
Comment 3 Aditya Keerthi 2021-10-04 10:15:49 PDT
(In reply to Aditya Keerthi from comment #2)
> Comment on attachment 440043 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440043&action=review
> 
> > Source/WebCore/rendering/RenderThemeIOS.mm:2094
> > +        return nil;
> 
> `nullptr`?
> 
> > Source/WebCore/rendering/RenderThemeIOS.mm:2123
> > +    context.setFillGradient(*checkboxRadioBackgroundGradient(roundedRect.rect(), states));
> 
> This will result in a null deference in the pressed state.

s/deference/dereference/
Comment 4 Tim Horton 2021-10-04 15:45:54 PDT
Created attachment 440115 [details]
Patch
Comment 5 Aditya Keerthi 2021-10-04 16:16:16 PDT
Comment on attachment 440115 [details]
Patch

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

> Source/WebCore/rendering/RenderThemeIOS.mm:2120
> +    Path path;

Move inside the `if` directly below, since it's not used otherwise.
Comment 6 Tim Horton 2021-10-04 16:24:18 PDT
Created attachment 440119 [details]
Patch
Comment 7 Sam Weinig 2021-10-04 17:09:42 PDT
Comment on attachment 440119 [details]
Patch

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

> Source/WebCore/rendering/RenderThemeIOS.h:117
>  #if ENABLE(IOS_FORM_CONTROL_REFRESH)

Got to rename / remove this soon? Just as soon as we rename "modern-media-controls" right?

> Source/WebCore/rendering/RenderThemeIOS.mm:2070
> +        // FIXME: The disabled state for the alternate appearance is currently unspecified; this is just a guess.

Please make sure this has a bug.

> Source/WebCore/rendering/RenderThemeIOS.mm:2099
> +    gradient->addColorStop({ 1.0f, DisplayP3<float> { 0, 0, 0, 0 }});

Using DisplayP3 for these seem unnecessary (especially for the one that can use Color::transparentBlack), but you do you.
Comment 8 Tim Horton 2021-10-04 17:14:06 PDT
(In reply to Sam Weinig from comment #7)
> Comment on attachment 440119 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=440119&action=review
> 
> > Source/WebCore/rendering/RenderThemeIOS.h:117
> >  #if ENABLE(IOS_FORM_CONTROL_REFRESH)
> 
> Got to rename / remove this soon? Just as soon as we rename
> "modern-media-controls" right?

Aditya and I are talking about that; we think both the setting and the ifdef can just go away now.

> > Source/WebCore/rendering/RenderThemeIOS.mm:2070
> > +        // FIXME: The disabled state for the alternate appearance is currently unspecified; this is just a guess.
> 
> Please make sure this has a bug.

Yep, will file a few.

> > Source/WebCore/rendering/RenderThemeIOS.mm:2099
> > +    gradient->addColorStop({ 1.0f, DisplayP3<float> { 0, 0, 0, 0 }});
> 
> Using DisplayP3 for these seem unnecessary (especially for the one that can
> use Color::transparentBlack), but you do you.

True, I was just typing them all straight from a color picker from a P3-space document.
Comment 9 Tim Horton 2021-10-05 11:17:57 PDT
http://trac.webkit.org/changeset/283560/webkit
Comment 10 Radar WebKit Bug Importer 2021-10-05 11:18:17 PDT
<rdar://problem/83895320>