Bug 212476

Summary: [Apple Pay] Buttons render with a corner radius of PKApplePayButtonDefaultCornerRadius even when explicitly specifying "border-radius: 0px"
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: changseok, dino, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, joepeck, koivisto, kondapallykalyan, macpherson, menard, pdr, simon.fraser, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=212506
Bug Depends on: 238062    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Andy Estes 2020-05-28 10:32:32 PDT
[Apple Pay] Buttons render with a corner radius of PKApplePayButtonDefaultCornerRadius even when explicitly specifying "border-radius: 0px"
Comment 1 Andy Estes 2020-05-28 10:33:21 PDT
rdar://problem/63401433
Comment 2 Andy Estes 2020-05-28 10:56:12 PDT
Created attachment 400481 [details]
Patch
Comment 3 Simon Fraser (smfr) 2020-05-28 12:09:16 PDT
How does this interact with "all: unset" etc?
Comment 4 Antti Koivisto 2020-05-28 12:28:11 PDT
Comment on attachment 400481 [details]
Patch

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

> Source/WebCore/style/StyleBuilderCustom.h:127
> +    // FIXME: Teach makeprop.pl to generate setters for hasExplicitlySet* flags

Yes please. Doing this manually is bit silly.

Also we might want to track the cascade level instead (so property can be set on UA sheet without being considered 'explicitly set').
Comment 5 Andy Estes 2020-05-28 14:15:42 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> How does this interact with "all: unset" etc?

"all: unset" or "all: initial" would set border-radius back to its initial value, which would set hasExplicitlySetBorderRadius to false, and we would render at the default corner radius.

"all: revert" would roll back to the User or UA origin. As Antti pointed out in comment #4, if border-radius is set in one of those origins then we'd consider it "explicitly set" and use it instead of the default corner radius for Apple Pay buttons. In practice, our UA stylesheet does not set border-radius on any elements that authors would style with '-webkit-appearance: -apple-pay-button', so I think this is ok for now.

I'll do a few things as follow-up:
1. Update my tests to cover the 'all' shorthand.
2. File a bug for Antti's suggestion to track cascade level (and about the makeprop.pl improvement).
Comment 6 Andy Estes 2020-05-28 18:39:17 PDT
Created attachment 400536 [details]
Patch
Comment 7 EWS 2020-05-28 21:08:21 PDT
Committed r262279: <https://trac.webkit.org/changeset/262279>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400536 [details].