Title: [256648] trunk
Revision
256648
Author
commit-qu...@webkit.org
Date
2020-02-14 15:01:25 -0800 (Fri, 14 Feb 2020)

Log Message

WebKit support for Apple Pay Buttons with custom corner radii
https://bugs.webkit.org/show_bug.cgi?id=207664
Source/WebCore:

<rdar://problem/43718114>

Patch by Nikos Mouchtaris <nmouchta...@apple.com> on 2020-02-14
Reviewed by Andy Estes.

Added support for border-radius css property for apple pay
button drawing.

Modified old tests to test this new behavior.

* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::paintApplePayButton):

Source/WebCore/PAL:

<rdar://problem/43718114>

Patch by Nikos Mouchtaris <nmouchta...@apple.com> on 2020-02-14
Reviewed by Andy Estes.

Added link for PKDrawApplePayButtonWithCornerRadius and
PKApplePayButtonDefaultCornerRadius.

* pal/cocoa/PassKitSoftLink.h:
* pal/cocoa/PassKitSoftLink.mm:
* pal/spi/cocoa/PassKitSPI.h:

LayoutTests:

Patch by Nikos Mouchtaris <nmouchta...@apple.com> on 2020-02-14
Reviewed by Andy Estes.

Modified both tests to test new functionality for setting custom corner
radii.

* http/tests/ssl/applepay/ApplePayButton.html:
* http/tests/ssl/applepay/ApplePayButtonV4.html:
* platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png:
* platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt:
* platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png:
* platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt:
* platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png:
* platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256647 => 256648)


--- trunk/LayoutTests/ChangeLog	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/ChangeLog	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,3 +1,22 @@
+2020-02-14  Nikos Mouchtaris  <nmouchta...@apple.com>
+
+        WebKit support for Apple Pay Buttons with custom corner radii
+        https://bugs.webkit.org/show_bug.cgi?id=207664
+
+        Reviewed by Andy Estes.
+
+        Modified both tests to test new functionality for setting custom corner
+        radii.
+
+        * http/tests/ssl/applepay/ApplePayButton.html:
+        * http/tests/ssl/applepay/ApplePayButtonV4.html:
+        * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png:
+        * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt:
+        * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png:
+        * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt:
+        * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png:
+        * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt:
+
 2020-02-14  Ryan Haddad  <ryanhad...@apple.com>
 
         [Web Animations] Unflake web-animations/timing-model/timelines/update-and-send-events.html WPT test

Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButton.html (256647 => 256648)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButton.html	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButton.html	2020-02-14 23:01:25 UTC (rev 256648)
@@ -7,6 +7,7 @@
         .apple-pay-button {
             -webkit-appearance: -apple-pay-button;
             display: block;
+            float: left;
         }
 
         .white {
@@ -36,15 +37,24 @@
         .donate {
             -apple-pay-button-type: donate;
         }
+        .borderRadiusLarge {
+            border-top-left-radius: 20px/21px;
+            border-top-right-radius: 25px;
+            border-bottom-left-radius: 10px/1px;
+            border-bottom-right-radius: 5px;
+        }
     </style>
 </head>
-<body>
+<body bgcolor="#E6E6FA">
     <script>
         for (let style of ["white", "white-outline", "black"]) {
             for (let type of ["plain", "buy", "set-up", "donate"]) {
                 var button = document.createElement("button");
-                button.classList.add("apple-pay-button", style, type);
+                button.classList.add("apple-pay-button", style, type, "borderRadiusLarge");
+                var buttonNoRadius = document.createElement("button");
+                buttonNoRadius.classList.add("apple-pay-button", style, type);
                 document.body.appendChild(button);
+                document.body.appendChild(buttonNoRadius);
             }
         }
     </script>

Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html (256647 => 256648)


--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html	2020-02-14 23:01:25 UTC (rev 256648)
@@ -32,15 +32,24 @@
         .subscribe {
             -apple-pay-button-type: subscribe;
         }
+        .borderRadiusLarge {
+            border-top-left-radius: 20px/21px;
+            border-top-right-radius: 25px;
+            border-bottom-left-radius: 10px/1px;
+            border-bottom-right-radius: 5px;
+        }
     </style>
 </head>
-<body>
+<body bgcolor="#E6E6FA">
     <script>
         for (let style of ["white", "white-outline", "black"]) {
             for (let type of ["check-out", "book", "subscribe"]) {
                 var button = document.createElement("button");
-                button.classList.add("apple-pay-button", style, type);
+                button.classList.add("apple-pay-button", style, type, "borderRadiusLarge");
+                var buttonNoRadius = document.createElement("button");
+                buttonNoRadius.classList.add("apple-pay-button", style, type);
                 document.body.appendChild(button);
+                document.body.appendChild(buttonNoRadius);
             }
         }
     </script>

Modified: trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt (256647 => 256648)


--- trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,17 +1,29 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x398
-  RenderBlock {HTML} at (0,0) size 800x398
-    RenderBody {BODY} at (8,8) size 784x382
-      RenderButton {BUTTON} at (2,0) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,32) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,64) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,96) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,128) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,160) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,192) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,224) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,256) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,288) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,320) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,352) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+layer at (0,0) size 800x178
+  RenderBlock {HTML} at (0,0) size 800x178
+    RenderBody {BODY} at (8,8) size 784x0 [bgcolor=#E6E6FA]
+      RenderButton {BUTTON} at (2,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (106,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (210,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (354,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (498,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (642,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (394,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (498,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (642,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (434,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (578,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (682,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (434,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (578,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,138) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]

Modified: trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt (256647 => 256648)


--- trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x302
-  RenderBlock {HTML} at (0,0) size 800x302
-    RenderBody {BODY} at (8,8) size 784x286
+layer at (0,0) size 800x590
+  RenderBlock {HTML} at (0,0) size 800x590
+    RenderBody {BODY} at (8,8) size 784x574 [bgcolor=#E6E6FA]
       RenderButton {BUTTON} at (2,0) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
       RenderButton {BUTTON} at (2,32) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
       RenderButton {BUTTON} at (2,64) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
@@ -12,3 +12,12 @@
       RenderButton {BUTTON} at (2,192) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
       RenderButton {BUTTON} at (2,224) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
       RenderButton {BUTTON} at (2,256) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,288) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,320) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,352) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,384) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,416) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,448) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,480) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,512) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,544) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]

Modified: trunk/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt (256647 => 256648)


--- trunk/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,17 +1,29 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x398
-  RenderBlock {HTML} at (0,0) size 800x398
-    RenderBody {BODY} at (8,8) size 784x382
-      RenderButton {BUTTON} at (2,0) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,32) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,64) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,96) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,128) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,160) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,192) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,224) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,256) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,288) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,320) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
-      RenderButton {BUTTON} at (2,352) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+layer at (0,0) size 800x178
+  RenderBlock {HTML} at (0,0) size 800x178
+    RenderBody {BODY} at (8,8) size 784x0 [bgcolor=#E6E6FA]
+      RenderButton {BUTTON} at (2,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (106,2) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (210,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (354,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (498,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (642,2) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (394,36) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (498,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (642,36) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (434,70) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (578,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (682,70) size 100x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (146,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (290,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (434,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (578,104) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,138) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]

Modified: trunk/Source/WebCore/ChangeLog (256647 => 256648)


--- trunk/Source/WebCore/ChangeLog	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/ChangeLog	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,3 +1,19 @@
+2020-02-14  Nikos Mouchtaris  <nmouchta...@apple.com>
+
+        WebKit support for Apple Pay Buttons with custom corner radii
+        https://bugs.webkit.org/show_bug.cgi?id=207664
+        <rdar://problem/43718114> 
+
+        Reviewed by Andy Estes.
+
+        Added support for border-radius css property for apple pay
+        button drawing.
+
+        Modified old tests to test this new behavior.
+
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::RenderThemeCocoa::paintApplePayButton):
+
 2020-02-14  Antoine Quint  <grao...@webkit.org>
 
         [Web Animations] Missing call to DocumentTimeline::resumeAnimations() in Frame::resumeActiveDOMObjectsAndAnimations()

Modified: trunk/Source/WebCore/PAL/ChangeLog (256647 => 256648)


--- trunk/Source/WebCore/PAL/ChangeLog	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/PAL/ChangeLog	2020-02-14 23:01:25 UTC (rev 256648)
@@ -1,3 +1,18 @@
+2020-02-14  Nikos Mouchtaris  <nmouchta...@apple.com>
+
+        WebKit support for Apple Pay Buttons with custom corner radii
+        https://bugs.webkit.org/show_bug.cgi?id=207664
+        <rdar://problem/43718114>
+
+        Reviewed by Andy Estes.
+
+        Added link for PKDrawApplePayButtonWithCornerRadius and
+        PKApplePayButtonDefaultCornerRadius.
+
+        * pal/cocoa/PassKitSoftLink.h:
+        * pal/cocoa/PassKitSoftLink.mm:
+        * pal/spi/cocoa/PassKitSPI.h:
+
 2020-02-12  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r256010.

Modified: trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h (256647 => 256648)


--- trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h	2020-02-14 23:01:25 UTC (rev 256648)
@@ -47,13 +47,15 @@
 #endif
 
 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion))
-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))
+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))
 
+
 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationResult)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestPaymentMethodUpdate)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestShippingContactUpdate)
 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequestShippingMethodUpdate)
 
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKApplePayButtonDefaultCornerRadius, CGFloat)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldEmailAddress, PKContactField)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldName, PKContactField)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldPhoneNumber, PKContactField)

Modified: trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm (256647 => 256648)


--- trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm	2020-02-14 23:01:25 UTC (rev 256648)
@@ -51,7 +51,7 @@
 #endif
 
 SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion), PAL_EXPORT)
-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))
+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))
 
 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationResult, PAL_EXPORT)
 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestPaymentMethodUpdate, PAL_EXPORT)
@@ -58,6 +58,7 @@
 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestShippingContactUpdate, PAL_EXPORT)
 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestShippingMethodUpdate, PAL_EXPORT)
 
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKApplePayButtonDefaultCornerRadius, CGFloat, PAL_EXPORT)
 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldEmailAddress, PKContactField, PAL_EXPORT)
 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldName, PKContactField, PAL_EXPORT)
 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldPhoneNumber, PKContactField, PAL_EXPORT)

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (256647 => 256648)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h	2020-02-14 23:01:25 UTC (rev 256648)
@@ -364,7 +364,7 @@
 #endif
 
 extern "C"
-void PKDrawApplePayButton(_Nonnull CGContextRef, CGRect drawRect, CGFloat scale, PKPaymentButtonType, PKPaymentButtonStyle, NSString * _Nullable languageCode);
+void PKDrawApplePayButtonWithCornerRadius(_Nonnull CGContextRef, CGRect drawRect, CGFloat scale, CGFloat cornerRadius, PKPaymentButtonType, PKPaymentButtonStyle, NSString * _Nullable languageCode);
 
 NS_ASSUME_NONNULL_BEGIN
 

Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (256647 => 256648)


--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2020-02-14 22:45:08 UTC (rev 256647)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2020-02-14 23:01:25 UTC (rev 256648)
@@ -97,6 +97,23 @@
     }
 }
 
+static CGFloat largestCornerRadius(const RenderStyle& style)
+{
+    if (!style.hasBorderRadius())
+        return PAL::get_PassKit_PKApplePayButtonDefaultCornerRadius();
+
+    return std::max<CGFloat>({
+        style.borderTopLeftRadius().height.value(),
+        style.borderTopLeftRadius().width.value(),
+        style.borderTopRightRadius().height.value(),
+        style.borderTopRightRadius().width.value(),
+        style.borderBottomLeftRadius().height.value(),
+        style.borderBottomLeftRadius().width.value(),
+        style.borderBottomRightRadius().height.value(),
+        style.borderBottomRightRadius().width.value()
+    });
+}
+
 bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect)
 {
     GraphicsContextStateSaver stateSaver(paintInfo.context());
@@ -104,8 +121,7 @@
     paintInfo.context().setShouldSmoothFonts(true);
     paintInfo.context().scale(FloatSize(1, -1));
 
-    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());
-
+    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());
     return false;
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to