Changeset 256648 in webkit
- Timestamp:
- Feb 14, 2020 3:01:25 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r256645 r256648 1 2020-02-14 Nikos Mouchtaris <nmouchtaris@apple.com> 2 3 WebKit support for Apple Pay Buttons with custom corner radii 4 https://bugs.webkit.org/show_bug.cgi?id=207664 5 6 Reviewed by Andy Estes. 7 8 Modified both tests to test new functionality for setting custom corner 9 radii. 10 11 * http/tests/ssl/applepay/ApplePayButton.html: 12 * http/tests/ssl/applepay/ApplePayButtonV4.html: 13 * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png: 14 * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt: 15 * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png: 16 * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt: 17 * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png: 18 * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt: 19 1 20 2020-02-14 Ryan Haddad <ryanhaddad@apple.com> 2 21 -
trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButton.html
r236615 r256648 8 8 -webkit-appearance: -apple-pay-button; 9 9 display: block; 10 float: left; 10 11 } 11 12 … … 37 38 -apple-pay-button-type: donate; 38 39 } 40 .borderRadiusLarge { 41 border-top-left-radius: 20px/21px; 42 border-top-right-radius: 25px; 43 border-bottom-left-radius: 10px/1px; 44 border-bottom-right-radius: 5px; 45 } 39 46 </style> 40 47 </head> 41 <body >48 <body bgcolor="#E6E6FA"> 42 49 <script> 43 50 for (let style of ["white", "white-outline", "black"]) { 44 51 for (let type of ["plain", "buy", "set-up", "donate"]) { 45 52 var button = document.createElement("button"); 46 button.classList.add("apple-pay-button", style, type); 53 button.classList.add("apple-pay-button", style, type, "borderRadiusLarge"); 54 var buttonNoRadius = document.createElement("button"); 55 buttonNoRadius.classList.add("apple-pay-button", style, type); 47 56 document.body.appendChild(button); 57 document.body.appendChild(buttonNoRadius); 48 58 } 49 59 } -
trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html
r235754 r256648 33 33 -apple-pay-button-type: subscribe; 34 34 } 35 .borderRadiusLarge { 36 border-top-left-radius: 20px/21px; 37 border-top-right-radius: 25px; 38 border-bottom-left-radius: 10px/1px; 39 border-bottom-right-radius: 5px; 40 } 35 41 </style> 36 42 </head> 37 <body >43 <body bgcolor="#E6E6FA"> 38 44 <script> 39 45 for (let style of ["white", "white-outline", "black"]) { 40 46 for (let type of ["check-out", "book", "subscribe"]) { 41 47 var button = document.createElement("button"); 42 button.classList.add("apple-pay-button", style, type); 48 button.classList.add("apple-pay-button", style, type, "borderRadiusLarge"); 49 var buttonNoRadius = document.createElement("button"); 50 buttonNoRadius.classList.add("apple-pay-button", style, type); 43 51 document.body.appendChild(button); 52 document.body.appendChild(buttonNoRadius); 44 53 } 45 54 } -
trunk/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt
r236615 r256648 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x398 4 RenderBlock {HTML} at (0,0) size 800x398 5 RenderBody {BODY} at (8,8) size 784x382 6 RenderButton {BUTTON} at (2,0) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 7 RenderButton {BUTTON} at (2,32) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 8 RenderButton {BUTTON} at (2,64) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 9 RenderButton {BUTTON} at (2,96) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 10 RenderButton {BUTTON} at (2,128) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 11 RenderButton {BUTTON} at (2,160) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 12 RenderButton {BUTTON} at (2,192) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 13 RenderButton {BUTTON} at (2,224) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 14 RenderButton {BUTTON} at (2,256) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 15 RenderButton {BUTTON} at (2,288) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 16 RenderButton {BUTTON} at (2,320) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 17 RenderButton {BUTTON} at (2,352) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 3 layer at (0,0) size 800x178 4 RenderBlock {HTML} at (0,0) size 800x178 5 RenderBody {BODY} at (8,8) size 784x0 [bgcolor=#E6E6FA] 6 RenderButton {BUTTON} at (2,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 7 RenderButton {BUTTON} at (106,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 8 RenderButton {BUTTON} at (210,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 9 RenderButton {BUTTON} at (354,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 10 RenderButton {BUTTON} at (498,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 11 RenderButton {BUTTON} at (642,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 12 RenderButton {BUTTON} at (2,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 13 RenderButton {BUTTON} at (146,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 14 RenderButton {BUTTON} at (290,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 15 RenderButton {BUTTON} at (394,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 16 RenderButton {BUTTON} at (498,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 17 RenderButton {BUTTON} at (642,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 18 RenderButton {BUTTON} at (2,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 19 RenderButton {BUTTON} at (146,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 20 RenderButton {BUTTON} at (290,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 21 RenderButton {BUTTON} at (434,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 22 RenderButton {BUTTON} at (578,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 23 RenderButton {BUTTON} at (682,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 24 RenderButton {BUTTON} at (2,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 25 RenderButton {BUTTON} at (146,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 26 RenderButton {BUTTON} at (290,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 27 RenderButton {BUTTON} at (434,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 28 RenderButton {BUTTON} at (578,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 29 RenderButton {BUTTON} at (2,138) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] -
trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt
r236615 r256648 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x398 4 RenderBlock {HTML} at (0,0) size 800x398 5 RenderBody {BODY} at (8,8) size 784x382 6 RenderButton {BUTTON} at (2,0) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 7 RenderButton {BUTTON} at (2,32) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 8 RenderButton {BUTTON} at (2,64) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 9 RenderButton {BUTTON} at (2,96) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 10 RenderButton {BUTTON} at (2,128) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 11 RenderButton {BUTTON} at (2,160) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 12 RenderButton {BUTTON} at (2,192) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 13 RenderButton {BUTTON} at (2,224) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 14 RenderButton {BUTTON} at (2,256) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 15 RenderButton {BUTTON} at (2,288) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 16 RenderButton {BUTTON} at (2,320) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 17 RenderButton {BUTTON} at (2,352) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 3 layer at (0,0) size 800x178 4 RenderBlock {HTML} at (0,0) size 800x178 5 RenderBody {BODY} at (8,8) size 784x0 [bgcolor=#E6E6FA] 6 RenderButton {BUTTON} at (2,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 7 RenderButton {BUTTON} at (106,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 8 RenderButton {BUTTON} at (210,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 9 RenderButton {BUTTON} at (354,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 10 RenderButton {BUTTON} at (498,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 11 RenderButton {BUTTON} at (642,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 12 RenderButton {BUTTON} at (2,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 13 RenderButton {BUTTON} at (146,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 14 RenderButton {BUTTON} at (290,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 15 RenderButton {BUTTON} at (394,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 16 RenderButton {BUTTON} at (498,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 17 RenderButton {BUTTON} at (642,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 18 RenderButton {BUTTON} at (2,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 19 RenderButton {BUTTON} at (146,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 20 RenderButton {BUTTON} at (290,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 21 RenderButton {BUTTON} at (434,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 22 RenderButton {BUTTON} at (578,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 23 RenderButton {BUTTON} at (682,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 24 RenderButton {BUTTON} at (2,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 25 RenderButton {BUTTON} at (146,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 26 RenderButton {BUTTON} at (290,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 27 RenderButton {BUTTON} at (434,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 28 RenderButton {BUTTON} at (578,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 29 RenderButton {BUTTON} at (2,138) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] -
trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt
r235349 r256648 1 1 layer at (0,0) size 800x600 2 2 RenderView at (0,0) size 800x600 3 layer at (0,0) size 800x 3024 RenderBlock {HTML} at (0,0) size 800x 3025 RenderBody {BODY} at (8,8) size 784x 2863 layer at (0,0) size 800x590 4 RenderBlock {HTML} at (0,0) size 800x590 5 RenderBody {BODY} at (8,8) size 784x574 [bgcolor=#E6E6FA] 6 6 RenderButton {BUTTON} at (2,0) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 7 7 RenderButton {BUTTON} at (2,32) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] … … 13 13 RenderButton {BUTTON} at (2,224) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 14 14 RenderButton {BUTTON} at (2,256) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 15 RenderButton {BUTTON} at (2,288) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 16 RenderButton {BUTTON} at (2,320) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 17 RenderButton {BUTTON} at (2,352) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 18 RenderButton {BUTTON} at (2,384) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 19 RenderButton {BUTTON} at (2,416) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 20 RenderButton {BUTTON} at (2,448) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 21 RenderButton {BUTTON} at (2,480) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 22 RenderButton {BUTTON} at (2,512) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] 23 RenderButton {BUTTON} at (2,544) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] -
trunk/Source/WebCore/ChangeLog
r256636 r256648 1 2020-02-14 Nikos Mouchtaris <nmouchtaris@apple.com> 2 3 WebKit support for Apple Pay Buttons with custom corner radii 4 https://bugs.webkit.org/show_bug.cgi?id=207664 5 <rdar://problem/43718114> 6 7 Reviewed by Andy Estes. 8 9 Added support for border-radius css property for apple pay 10 button drawing. 11 12 Modified old tests to test this new behavior. 13 14 * rendering/RenderThemeCocoa.mm: 15 (WebCore::RenderThemeCocoa::paintApplePayButton): 16 1 17 2020-02-14 Antoine Quint <graouts@webkit.org> 2 18 -
trunk/Source/WebCore/PAL/ChangeLog
r256493 r256648 1 2020-02-14 Nikos Mouchtaris <nmouchtaris@apple.com> 2 3 WebKit support for Apple Pay Buttons with custom corner radii 4 https://bugs.webkit.org/show_bug.cgi?id=207664 5 <rdar://problem/43718114> 6 7 Reviewed by Andy Estes. 8 9 Added link for PKDrawApplePayButtonWithCornerRadius and 10 PKApplePayButtonDefaultCornerRadius. 11 12 * pal/cocoa/PassKitSoftLink.h: 13 * pal/cocoa/PassKitSoftLink.mm: 14 * pal/spi/cocoa/PassKitSPI.h: 15 1 16 2020-02-12 Ryan Haddad <ryanhaddad@apple.com> 2 17 -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h
r250048 r256648 48 48 49 49 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion)) 50 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode)) 50 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKDrawApplePayButtonWithCornerRadius, void, (CGContextRef context, CGRect drawRect, CGFloat scale, CGFloat cornerRadius, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, cornerRadius, type, style, languageCode)) 51 51 52 52 53 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationResult) … … 55 56 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestShippingMethodUpdate) 56 57 58 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKApplePayButtonDefaultCornerRadius, CGFloat) 57 59 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldEmailAddress, PKContactField) 58 60 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldName, PKContactField) -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm
r250048 r256648 52 52 53 53 SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion), PAL_EXPORT) 54 SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, PassKit, PKDrawApplePayButton , void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode))54 SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, PassKit, PKDrawApplePayButtonWithCornerRadius, void, (CGContextRef context, CGRect drawRect, CGFloat scale, CGFloat cornerRadius, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, cornerRadius, type, style, languageCode)) 55 55 56 56 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationResult, PAL_EXPORT) … … 59 59 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestShippingMethodUpdate, PAL_EXPORT) 60 60 61 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKApplePayButtonDefaultCornerRadius, CGFloat, PAL_EXPORT) 61 62 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldEmailAddress, PKContactField, PAL_EXPORT) 62 63 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldName, PKContactField, PAL_EXPORT) -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r256071 r256648 365 365 366 366 extern "C" 367 void PKDrawApplePayButton (_Nonnull CGContextRef, CGRect drawRect, CGFloat scale, PKPaymentButtonType, PKPaymentButtonStyle, NSString * _Nullable languageCode);367 void PKDrawApplePayButtonWithCornerRadius(_Nonnull CGContextRef, CGRect drawRect, CGFloat scale, CGFloat cornerRadius, PKPaymentButtonType, PKPaymentButtonStyle, NSString * _Nullable languageCode); 368 368 369 369 NS_ASSUME_NONNULL_BEGIN -
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
r252308 r256648 98 98 } 99 99 100 static CGFloat largestCornerRadius(const RenderStyle& style) 101 { 102 if (!style.hasBorderRadius()) 103 return PAL::get_PassKit_PKApplePayButtonDefaultCornerRadius(); 104 105 return std::max<CGFloat>({ 106 style.borderTopLeftRadius().height.value(), 107 style.borderTopLeftRadius().width.value(), 108 style.borderTopRightRadius().height.value(), 109 style.borderTopRightRadius().width.value(), 110 style.borderBottomLeftRadius().height.value(), 111 style.borderBottomLeftRadius().width.value(), 112 style.borderBottomRightRadius().height.value(), 113 style.borderBottomRightRadius().width.value() 114 }); 115 } 116 100 117 bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect) 101 118 { … … 105 122 paintInfo.context().scale(FloatSize(1, -1)); 106 123 107 PKDrawApplePayButton(paintInfo.context().platformContext(), CGRectMake(paintRect.x(), -paintRect.maxY(), paintRect.width(), paintRect.height()), 1.0, toPKPaymentButtonType(renderer.style().applePayButtonType()), toPKPaymentButtonStyle(renderer.style().applePayButtonStyle()), renderer.style().locale()); 108 124 PKDrawApplePayButtonWithCornerRadius(paintInfo.context().platformContext(), CGRectMake(paintRect.x(), -paintRect.maxY(), paintRect.width(), paintRect.height()), 1.0, largestCornerRadius(renderer.style()), toPKPaymentButtonType(renderer.style().applePayButtonType()), toPKPaymentButtonStyle(renderer.style().applePayButtonStyle()), renderer.style().locale()); 109 125 return false; 110 126 }
Note: See TracChangeset
for help on using the changeset viewer.