[PaymentRequest] Remove currencySystem member
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2018 17:09:59 +0000 (17:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 May 2018 17:09:59 +0000 (17:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185860

Patch by Jinho Bang <zino@chromium.org> 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:

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

LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt
LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.h
Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.idl
Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
Source/WebCore/inspector/WebInjectedScriptHost.cpp

index 7b5cfca..3461648 100644 (file)
@@ -1,3 +1,13 @@
+2018-05-24  Jinho Bang  <zino@chromium.org>
+
+        [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  <cdumez@apple.com>
 
         Regression(r229831): fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html is flaky
index 7bd401c..e2c72c4 100644 (file)
@@ -10,8 +10,7 @@ INTERNAL PROPERTY: details: {
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "99.00",
-      "currencySystem": "<filtered>"
+      "value": "99.00"
     },
     "pending": false
   },
@@ -20,8 +19,7 @@ INTERNAL PROPERTY: details: {
       "label": "Item 1",
       "amount": {
         "currency": "USD",
-        "value": "90.00",
-        "currencySystem": "<filtered>"
+        "value": "90.00"
       },
       "pending": false
     },
@@ -29,8 +27,7 @@ INTERNAL PROPERTY: details: {
       "label": "Item 2",
       "amount": {
         "currency": "USD",
-        "value": "90.00",
-        "currencySystem": "<filtered>"
+        "value": "90.00"
       },
       "pending": true
     },
@@ -38,8 +35,7 @@ INTERNAL PROPERTY: details: {
       "label": "Item 3",
       "amount": {
         "currency": "USD",
-        "value": "9.00",
-        "currencySystem": "<filtered>"
+        "value": "9.00"
       },
       "pending": false
     }
@@ -50,8 +46,7 @@ INTERNAL PROPERTY: details: {
       "label": "Shipping Label 1",
       "amount": {
         "currency": "USD",
-        "value": "5.00",
-        "currencySystem": "<filtered>"
+        "value": "5.00"
       },
       "selected": false
     },
@@ -60,8 +55,7 @@ INTERNAL PROPERTY: details: {
       "label": "Shipping Label 2",
       "amount": {
         "currency": "USD",
-        "value": "10.00",
-        "currencySystem": "<filtered>"
+        "value": "10.00"
       },
       "selected": true
     }
@@ -73,8 +67,7 @@ INTERNAL PROPERTY: details: {
         "label": "Total",
         "amount": {
           "currency": "USD",
-          "value": "99.00",
-          "currencySystem": "<filtered>"
+          "value": "99.00"
         },
         "pending": false
       },
@@ -99,8 +92,7 @@ INTERNAL PROPERTY: details: {
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },
@@ -124,8 +116,7 @@ INTERNAL PROPERTY: details: {
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },
@@ -149,8 +140,7 @@ INTERNAL PROPERTY: details: {
     "label": "Total",
     "amount": {
       "currency": "USD",
-      "value": "9.99",
-      "currencySystem": "<filtered>"
+      "value": "9.99"
     },
     "pending": false
   },
index 35d86b9..b705971 100644 (file)
@@ -112,8 +112,6 @@ function test()
             return JSON.stringify(this, (key, value) => {
                 if (key === "id")
                     return "<filtered>";
-                if (key === "currencySystem")
-                    return "<filtered>";
                 return value;
             }, 2);
         }
index 27918ba..9786ff3 100644 (file)
@@ -1,3 +1,27 @@
+2018-05-24  Jinho Bang  <zino@chromium.org>
+
+        [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  <zalan@apple.com>
 
         [LFC] Implement position computation for inflow positioned elements
index 4b5fb2c..63676e8 100644 (file)
@@ -34,7 +34,6 @@ namespace WebCore {
 struct PaymentCurrencyAmount {
     String currency;
     String value;
-    String currencySystem;
 };
 
 } // namespace WebCore
index 2e8eed1..524e983 100644 (file)
@@ -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";
 };
index f11178f..b92cb2e 100644 (file)
@@ -138,9 +138,6 @@ static bool isValidDecimalMonetaryValue(StringView value)
 // 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 @@ static ExceptionOr<void> checkAndCanonicalizeAmount(PaymentCurrencyAmount& amoun
 // 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;
index 9064b24..2997d7d 100644 (file)
@@ -84,7 +84,6 @@ static JSObject* objectForPaymentCurrencyAmount(VM& vm, ExecState* exec, const P
     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;
 }