Title: [232155] trunk
Revision
232155
Author
[email protected]
Date
2018-05-24 10:09:59 -0700 (Thu, 24 May 2018)

Log Message

[PaymentRequest] Remove currencySystem member
https://bugs.webkit.org/show_bug.cgi?id=185860

Patch by Jinho Bang <[email protected]> on 2018-05-24
Reviewed by Andy Estes.

Source/WebCore:

After a long discussion, Web Payment Working Group decided to remove
the `currencySystem` member[1]. The currency code should be well-formed
3-letter alphabetic code and is allowed even if that is not part of
the official ISO 4217 list.

[1] https://github.com/w3c/payment-request/pull/694

Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html

* Modules/paymentrequest/PaymentCurrencyAmount.h:
* Modules/paymentrequest/PaymentCurrencyAmount.idl:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::checkAndCanonicalizeAmount):
(WebCore::checkAndCanonicalizeTotal):
* inspector/WebInjectedScriptHost.cpp:
(WebCore::objectForPaymentCurrencyAmount):

LayoutTests:

* http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt:
* http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (232154 => 232155)


--- trunk/LayoutTests/ChangeLog	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/LayoutTests/ChangeLog	2018-05-24 17:09:59 UTC (rev 232155)
@@ -1,3 +1,13 @@
+2018-05-24  Jinho Bang  <[email protected]>
+
+        [PaymentRequest] Remove currencySystem member
+        https://bugs.webkit.org/show_bug.cgi?id=185860
+
+        Reviewed by Andy Estes.
+
+        * http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt:
+        * http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html:
+
 2018-05-23  Chris Dumez  <[email protected]>
 
         Regression(r229831): fast/loader/_javascript_-url-iframe-remove-on-navigate-async-delegate.html is flaky

Modified: trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt (232154 => 232155)


--- trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt	2018-05-24 17:09:59 UTC (rev 232155)
@@ -10,8 +10,7 @@
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "99.00",
-      "currencySystem": "<filtered>"
+      "value": "99.00"
     },
     "pending": false
   },
@@ -20,8 +19,7 @@
       "label": "Item 1",
       "amount": {
         "currency": "USD",
-        "value": "90.00",
-        "currencySystem": "<filtered>"
+        "value": "90.00"
       },
       "pending": false
     },
@@ -29,8 +27,7 @@
       "label": "Item 2",
       "amount": {
         "currency": "USD",
-        "value": "90.00",
-        "currencySystem": "<filtered>"
+        "value": "90.00"
       },
       "pending": true
     },
@@ -38,8 +35,7 @@
       "label": "Item 3",
       "amount": {
         "currency": "USD",
-        "value": "9.00",
-        "currencySystem": "<filtered>"
+        "value": "9.00"
       },
       "pending": false
     }
@@ -50,8 +46,7 @@
       "label": "Shipping Label 1",
       "amount": {
         "currency": "USD",
-        "value": "5.00",
-        "currencySystem": "<filtered>"
+        "value": "5.00"
       },
       "selected": false
     },
@@ -60,8 +55,7 @@
       "label": "Shipping Label 2",
       "amount": {
         "currency": "USD",
-        "value": "10.00",
-        "currencySystem": "<filtered>"
+        "value": "10.00"
       },
       "selected": true
     }
@@ -73,8 +67,7 @@
         "label": "Total",
         "amount": {
           "currency": "USD",
-          "value": "99.00",
-          "currencySystem": "<filtered>"
+          "value": "99.00"
         },
         "pending": false
       },
@@ -99,8 +92,7 @@
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },
@@ -124,8 +116,7 @@
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },
@@ -149,8 +140,7 @@
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },

Modified: trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html (232154 => 232155)


--- trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html	2018-05-24 17:09:59 UTC (rev 232155)
@@ -112,8 +112,6 @@
             return JSON.stringify(this, (key, value) => {
                 if (key === "id")
                     return "<filtered>";
-                if (key === "currencySystem")
-                    return "<filtered>";
                 return value;
             }, 2);
         }

Modified: trunk/Source/WebCore/ChangeLog (232154 => 232155)


--- trunk/Source/WebCore/ChangeLog	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/Source/WebCore/ChangeLog	2018-05-24 17:09:59 UTC (rev 232155)
@@ -1,3 +1,27 @@
+2018-05-24  Jinho Bang  <[email protected]>
+
+        [PaymentRequest] Remove currencySystem member
+        https://bugs.webkit.org/show_bug.cgi?id=185860
+
+        Reviewed by Andy Estes.
+
+        After a long discussion, Web Payment Working Group decided to remove
+        the `currencySystem` member[1]. The currency code should be well-formed
+        3-letter alphabetic code and is allowed even if that is not part of
+        the official ISO 4217 list.
+
+        [1] https://github.com/w3c/payment-request/pull/694
+
+        Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
+
+        * Modules/paymentrequest/PaymentCurrencyAmount.h:
+        * Modules/paymentrequest/PaymentCurrencyAmount.idl:
+        * Modules/paymentrequest/PaymentRequest.cpp:
+        (WebCore::checkAndCanonicalizeAmount):
+        (WebCore::checkAndCanonicalizeTotal):
+        * inspector/WebInjectedScriptHost.cpp:
+        (WebCore::objectForPaymentCurrencyAmount):
+
 2018-05-24  Zalan Bujtas  <[email protected]>
 
         [LFC] Implement position computation for inflow positioned elements

Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.h (232154 => 232155)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.h	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.h	2018-05-24 17:09:59 UTC (rev 232155)
@@ -34,7 +34,6 @@
 struct PaymentCurrencyAmount {
     String currency;
     String value;
-    String currencySystem;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.idl (232154 => 232155)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.idl	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.idl	2018-05-24 17:09:59 UTC (rev 232155)
@@ -28,6 +28,4 @@
 ] dictionary PaymentCurrencyAmount {
     required DOMString currency;
     required DOMString value;
-    // Note: currencySystem is "at risk" of being removed!
-    DOMString currencySystem = "urn:iso:std:iso:4217";
 };

Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp (232154 => 232155)


--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp	2018-05-24 17:09:59 UTC (rev 232155)
@@ -138,9 +138,6 @@
 // https://www.w3.org/TR/payment-request/#dfn-check-and-canonicalize-amount
 static ExceptionOr<void> checkAndCanonicalizeAmount(PaymentCurrencyAmount& amount)
 {
-    if (amount.currencySystem != "urn:iso:std:iso:4217")
-        return { };
-
     if (!isWellFormedCurrencyCode(amount.currency))
         return Exception { RangeError, makeString("\"", amount.currency, "\" is not a valid currency code.") };
 
@@ -155,9 +152,6 @@
 // https://www.w3.org/TR/payment-request/#dfn-check-and-canonicalize-total
 static ExceptionOr<void> checkAndCanonicalizeTotal(PaymentCurrencyAmount& total)
 {
-    if (total.currencySystem != "urn:iso:std:iso:4217")
-        return { };
-
     auto exception = checkAndCanonicalizeAmount(total);
     if (exception.hasException())
         return exception;

Modified: trunk/Source/WebCore/inspector/WebInjectedScriptHost.cpp (232154 => 232155)


--- trunk/Source/WebCore/inspector/WebInjectedScriptHost.cpp	2018-05-24 16:57:24 UTC (rev 232154)
+++ trunk/Source/WebCore/inspector/WebInjectedScriptHost.cpp	2018-05-24 17:09:59 UTC (rev 232155)
@@ -84,7 +84,6 @@
     auto* object = constructEmptyObject(exec);
     object->putDirect(vm, Identifier::fromString(exec, "currency"), jsString(exec, paymentCurrencyAmount.currency));
     object->putDirect(vm, Identifier::fromString(exec, "value"), jsString(exec, paymentCurrencyAmount.value));
-    object->putDirect(vm, Identifier::fromString(exec, "currencySystem"), jsString(exec, paymentCurrencyAmount.currencySystem));
     return object;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to