[Apple Pay] Introduce new values for -apple-pay-button-type
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2018 03:32:48 +0000 (03:32 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Aug 2018 03:32:48 +0000 (03:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188949
<rdar://problem/39992228>

Reviewed by Anders Carlsson.

Source/WebCore:

Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
and mapped those values to their equivalent PKPaymentButtonTypes.

Tests: http/tests/ssl/applepay/ApplePayButton.html
       http/tests/ssl/applepay/ApplePayButtonV4.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:

Source/WebCore/PAL:

* pal/spi/cocoa/PassKitSPI.h:

LayoutTests:

* http/tests/ssl/applepay/ApplePayButton.html: Added.
* http/tests/ssl/applepay/ApplePayButtonV4.html: Added.
* 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: Added.
* platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt: Added.
* platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png: Added.
* platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt: Added.
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235349 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/ssl/applepay/ApplePayButton.html
LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html [new file with mode: 0644]
LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png
LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png
LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt
LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/rendering/RenderThemeCocoa.mm
Source/WebCore/rendering/style/RenderStyleConstants.h

index c88fe31..131ad82 100644 (file)
@@ -1,5 +1,23 @@
 2018-08-26  Andy Estes  <aestes@apple.com>
 
+        [Apple Pay] Introduce new values for -apple-pay-button-type
+        https://bugs.webkit.org/show_bug.cgi?id=188949
+        <rdar://problem/39992228>
+
+        Reviewed by Anders Carlsson.
+
+        * http/tests/ssl/applepay/ApplePayButton.html: Added.
+        * http/tests/ssl/applepay/ApplePayButtonV4.html: Added.
+        * 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: Added.
+        * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt: Added.
+        * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png: Added.
+        * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt: Added.
+        * platform/mac-wk2/TestExpectations:
+
+2018-08-26  Andy Estes  <aestes@apple.com>
+
         Update test expectations for http/tests/ssl/applepay/ApplePayButton.html on macOS High Sierra.
 
         * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png: Renamed from LayoutTests/platform/mac-sierra/http/tests/ssl/applepay/ApplePayButton-expected.png.
index 662bcb5..b1ec686 100644 (file)
             -apple-pay-button-type: set-up;
         }
 
+        .in-store {
+            -apple-pay-button-type: in-store;
+        }
+
         .donate {
             -apple-pay-button-type: donate;
         }
@@ -41,7 +45,7 @@
 <body>
     <script>
         for (let style of ["white", "white-outline", "black"]) {
-            for (let type of ["plain", "buy", "set-up", "donate"]) {
+            for (let type of ["plain", "buy", "set-up", "in-store", "donate"]) {
                 var button = document.createElement("button");
                 button.classList.add("apple-pay-button", style, type);
                 document.body.appendChild(button);
diff --git a/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html b/LayoutTests/http/tests/ssl/applepay/ApplePayButtonV4.html
new file mode 100644 (file)
index 0000000..b0ec2b2
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>Test rendering Apple Pay buttons in version 4</title>
+    <style>
+        .apple-pay-button {
+            -webkit-appearance: -apple-pay-button;
+            display: block;
+        }
+
+        .white {
+            -apple-pay-button-style: white;
+        }
+
+        .white-outline {
+            -apple-pay-button-style: white-outline;
+        }
+
+        .black {
+            -apple-pay-button-style: black;
+        }
+
+        .checkout {
+            -apple-pay-button-type: checkout;
+        }
+
+        .book {
+            -apple-pay-button-type: book;
+        }
+
+        .subscribe {
+            -apple-pay-button-type: subscribe;
+        }
+    </style>
+</head>
+<body>
+    <script>
+        for (let style of ["white", "white-outline", "black"]) {
+            for (let type of ["checkout", "book", "subscribe"]) {
+                var button = document.createElement("button");
+                button.classList.add("apple-pay-button", style, type);
+                document.body.appendChild(button);
+            }
+        }
+    </script>
+</body>
+</html>
index 6c9d8d4..4438b92 100644 (file)
Binary files a/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png and b/LayoutTests/platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png differ
index 6e30e61..945c492 100644 (file)
@@ -1,17 +1,20 @@
 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
+layer at (0,0) size 800x494
+  RenderBlock {HTML} at (0,0) size 800x494
+    RenderBody {BODY} at (8,8) size 784x478
       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,128) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,160) size 100x30 [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,256) size 140x30 [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,320) size 100x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
       RenderButton {BUTTON} at (2,352) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,384) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,416) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,448) size 140x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
index 4dbb476..0b9f88a 100644 (file)
@@ -21,10 +21,12 @@ fast/media/mq-monochrome-live-update.html [ Pass ]
 fast/media/mq-prefers-reduced-motion-live-update.html [ Pass ]
 
 [ Sierra+ ] http/tests/ssl/applepay/ [ Pass ]
+[ Sierra ] http/tests/ssl/applepay/ApplePayButtonV4.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePayError.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePaySessionV3.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Skip ]
 [ Sierra ] http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html [ Skip ]
+[ HighSierra ] http/tests/ssl/applepay/ApplePayButtonV4.html [ Skip ]
 [ HighSierra ] http/tests/ssl/applepay/ApplePaySessionV4.html [ Skip ]
 
 fast/visual-viewport/rubberbanding-viewport-rects.html [ Pass ]
index 1952339..c9ce9e7 100644 (file)
Binary files a/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png and b/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png differ
index b51a612..293fcff 100644 (file)
@@ -1,17 +1,20 @@
 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
+layer at (0,0) size 800x494
+  RenderBlock {HTML} at (0,0) size 800x494
+    RenderBody {BODY} at (8,8) size 784x478
       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,128) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,160) size 100x30 [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,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,320) size 100x30 [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)]
diff --git a/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png b/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png
new file mode 100644 (file)
index 0000000..6b367b4
Binary files /dev/null and b/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png differ
diff --git a/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt b/LayoutTests/platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt
new file mode 100644 (file)
index 0000000..3e8b460
--- /dev/null
@@ -0,0 +1,14 @@
+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
+      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)]
+      RenderButton {BUTTON} at (2,96) size 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
+      RenderButton {BUTTON} at (2,128) size 140x30 [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 140x30 [color=#000000D8] [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)]
index 55f0236..3ac24e8 100644 (file)
@@ -1,3 +1,27 @@
+2018-08-26  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Introduce new values for -apple-pay-button-type
+        https://bugs.webkit.org/show_bug.cgi?id=188949
+        <rdar://problem/39992228>
+
+        Reviewed by Anders Carlsson.
+
+        Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
+        and mapped those values to their equivalent PKPaymentButtonTypes.
+
+        Tests: http/tests/ssl/applepay/ApplePayButton.html
+               http/tests/ssl/applepay/ApplePayButtonV4.html
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
+        * css/CSSValueKeywords.in:
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::toPKPaymentButtonType):
+        * rendering/style/RenderStyleConstants.h:
+
 2018-08-26  Youenn Fablet  <youenn@apple.com>
 
         Make IDBCursor::m_request a WeakPtr
index 52d92d5..a9c4bbc 100644 (file)
@@ -1,3 +1,13 @@
+2018-08-26  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Introduce new values for -apple-pay-button-type
+        https://bugs.webkit.org/show_bug.cgi?id=188949
+        <rdar://problem/39992228>
+
+        Reviewed by Anders Carlsson.
+
+        * pal/spi/cocoa/PassKitSPI.h:
+
 2018-08-23  Andy Estes  <aestes@apple.com>
 
         [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
index 5159cec..5095d34 100644 (file)
@@ -275,6 +275,12 @@ typedef NS_ENUM(NSInteger, PKPaymentButtonType) {
     PKPaymentButtonTypeBuy,
     PKPaymentButtonTypeSetUp,
     PKPaymentButtonTypeInStore,
+    PKPaymentButtonTypeDonate,
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 120000)
+    PKPaymentButtonTypeCheckout,
+    PKPaymentButtonTypeBook,
+    PKPaymentButtonTypeSubscribe,
+#endif
 };
 #endif
 
index 6794ef9..95b3f95 100644 (file)
@@ -5475,9 +5475,23 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ApplePayButtonType e)
     case ApplePayButtonType::SetUp:
         m_value.valueID = CSSValueSetUp;
         break;
+    case ApplePayButtonType::InStore:
+        m_value.valueID = CSSValueInStore;
+        break;
     case ApplePayButtonType::Donate:
         m_value.valueID = CSSValueDonate;
         break;
+#if ENABLE(APPLE_PAY_SESSION_V4)
+    case ApplePayButtonType::Checkout:
+        m_value.valueID = CSSValueCheckout;
+        break;
+    case ApplePayButtonType::Book:
+        m_value.valueID = CSSValueBook;
+        break;
+    case ApplePayButtonType::Subscribe:
+        m_value.valueID = CSSValueSubscribe;
+        break;
+#endif
 
     default:
         ASSERT_NOT_REACHED();
@@ -5495,8 +5509,18 @@ template<> inline CSSPrimitiveValue::operator ApplePayButtonType() const
         return ApplePayButtonType::Buy;
     case CSSValueSetUp:
         return ApplePayButtonType::SetUp;
+    case CSSValueInStore:
+        return ApplePayButtonType::InStore;
     case CSSValueDonate:
         return ApplePayButtonType::Donate;
+#if ENABLE(APPLE_PAY_SESSION_V4)
+    case CSSValueCheckout:
+        return ApplePayButtonType::Checkout;
+    case CSSValueBook:
+        return ApplePayButtonType::Book;
+    case CSSValueSubscribe:
+        return ApplePayButtonType::Subscribe;
+#endif
     default:
         break;
     }
index 9423127..74c450d 100644 (file)
@@ -1334,7 +1334,13 @@ white-outline
 plain
 buy
 set-up
+in-store
 donate
+#if defined(ENABLE_APPLE_PAY_SESSION_V4) && ENABLE_APPLE_PAY_SESSION_V4
+checkout
+book
+subscribe
+#endif
 #endif
 
 // font-synthesis
index a92b7c0..87bc573 100644 (file)
@@ -769,8 +769,14 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
 #if ENABLE(APPLE_PAY)
     case CSSPropertyApplePayButtonStyle: // white | white-outline | black
         return valueID == CSSValueWhite || valueID == CSSValueWhiteOutline || valueID == CSSValueBlack;
-    case CSSPropertyApplePayButtonType: // plain | buy | set-up | donate
-        return valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueDonate;
+    case CSSPropertyApplePayButtonType: // plain | buy | set-up | in-store | donate | checkout | book | subscribe
+        if (valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueInStore || valueID == CSSValueDonate)
+            return true;
+#if ENABLE(APPLE_PAY_SESSION_V4)
+        return valueID == CSSValueCheckout || valueID == CSSValueBook || valueID == CSSValueSubscribe;
+#else
+        return false;
+#endif
 #endif
     case CSSPropertyWebkitNbspMode: // normal | space
         return valueID == CSSValueNormal || valueID == CSSValueSpace;
index df2c731..c09f850 100644 (file)
@@ -87,9 +87,18 @@ static PKPaymentButtonType toPKPaymentButtonType(ApplePayButtonType type)
         return PKPaymentButtonTypeBuy;
     case ApplePayButtonType::SetUp:
         return PKPaymentButtonTypeSetUp;
+    case ApplePayButtonType::InStore:
+        return PKPaymentButtonTypeInStore;
     case ApplePayButtonType::Donate:
-        // FIXME: Use a named constant here.
-        return (PKPaymentButtonType)4;
+        return PKPaymentButtonTypeDonate;
+#if ENABLE(APPLE_PAY_SESSION_V4)
+    case ApplePayButtonType::Checkout:
+        return PKPaymentButtonTypeCheckout;
+    case ApplePayButtonType::Book:
+        return PKPaymentButtonTypeBook;
+    case ApplePayButtonType::Subscribe:
+        return PKPaymentButtonTypeSubscribe;
+#endif
     }
 }
 
index bf1c21e..943c62c 100644 (file)
@@ -1126,7 +1126,13 @@ enum class ApplePayButtonType : uint8_t {
     Plain,
     Buy,
     SetUp,
+    InStore,
     Donate,
+#if ENABLE(APPLE_PAY_SESSION_V4)
+    Checkout,
+    Book,
+    Subscribe,
+#endif
 };
 #endif