Changeset 232155 in webkit


Ignore:
Timestamp:
May 24, 2018 10:09:59 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

[PaymentRequest] Remove currencySystem member
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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r232144 r232155  
     12018-05-24  Jinho Bang  <zino@chromium.org>
     2
     3        [PaymentRequest] Remove currencySystem member
     4        https://bugs.webkit.org/show_bug.cgi?id=185860
     5
     6        Reviewed by Andy Estes.
     7
     8        * http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt:
     9        * http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html:
     10
    1112018-05-23  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https-expected.txt

    r224606 r232155  
    1111    "amount": {
    1212      "currency": "USD",
    13       "value": "99.00",
    14       "currencySystem": "<filtered>"
     13      "value": "99.00"
    1514    },
    1615    "pending": false
     
    2120      "amount": {
    2221        "currency": "USD",
    23         "value": "90.00",
    24         "currencySystem": "<filtered>"
     22        "value": "90.00"
    2523      },
    2624      "pending": false
     
    3028      "amount": {
    3129        "currency": "USD",
    32         "value": "90.00",
    33         "currencySystem": "<filtered>"
     30        "value": "90.00"
    3431      },
    3532      "pending": true
     
    3936      "amount": {
    4037        "currency": "USD",
    41         "value": "9.00",
    42         "currencySystem": "<filtered>"
     38        "value": "9.00"
    4339      },
    4440      "pending": false
     
    5147      "amount": {
    5248        "currency": "USD",
    53         "value": "5.00",
    54         "currencySystem": "<filtered>"
     49        "value": "5.00"
    5550      },
    5651      "selected": false
     
    6156      "amount": {
    6257        "currency": "USD",
    63         "value": "10.00",
    64         "currencySystem": "<filtered>"
     58        "value": "10.00"
    6559      },
    6660      "selected": true
     
    7468        "amount": {
    7569          "currency": "USD",
    76           "value": "99.00",
    77           "currencySystem": "<filtered>"
     70          "value": "99.00"
    7871        },
    7972        "pending": false
     
    10093    "amount": {
    10194      "currency": "USD",
    102       "value": "9.99",
    103       "currencySystem": "<filtered>"
     95      "value": "9.99"
    10496    },
    10597    "pending": false
     
    125117    "amount": {
    126118      "currency": "USD",
    127       "value": "9.99",
    128       "currencySystem": "<filtered>"
     119      "value": "9.99"
    129120    },
    130121    "pending": false
     
    150141    "amount": {
    151142      "currency": "USD",
    152       "value": "9.99",
    153       "currencySystem": "<filtered>"
     143      "value": "9.99"
    154144    },
    155145    "pending": false
  • trunk/LayoutTests/http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html

    r225950 r232155  
    113113                if (key === "id")
    114114                    return "<filtered>";
    115                 if (key === "currencySystem")
    116                     return "<filtered>";
    117115                return value;
    118116            }, 2);
  • trunk/Source/WebCore/ChangeLog

    r232154 r232155  
     12018-05-24  Jinho Bang  <zino@chromium.org>
     2
     3        [PaymentRequest] Remove currencySystem member
     4        https://bugs.webkit.org/show_bug.cgi?id=185860
     5
     6        Reviewed by Andy Estes.
     7
     8        After a long discussion, Web Payment Working Group decided to remove
     9        the `currencySystem` member[1]. The currency code should be well-formed
     10        3-letter alphabetic code and is allowed even if that is not part of
     11        the official ISO 4217 list.
     12
     13        [1] https://github.com/w3c/payment-request/pull/694
     14
     15        Test: http/tests/inspector/paymentrequest/payment-request-internal-properties.https.html
     16
     17        * Modules/paymentrequest/PaymentCurrencyAmount.h:
     18        * Modules/paymentrequest/PaymentCurrencyAmount.idl:
     19        * Modules/paymentrequest/PaymentRequest.cpp:
     20        (WebCore::checkAndCanonicalizeAmount):
     21        (WebCore::checkAndCanonicalizeTotal):
     22        * inspector/WebInjectedScriptHost.cpp:
     23        (WebCore::objectForPaymentCurrencyAmount):
     24
    1252018-05-24  Zalan Bujtas  <zalan@apple.com>
    226
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.h

    r220955 r232155  
    3535    String currency;
    3636    String value;
    37     String currencySystem;
    3837};
    3938
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentCurrencyAmount.idl

    r220955 r232155  
    2929    required DOMString currency;
    3030    required DOMString value;
    31     // Note: currencySystem is "at risk" of being removed!
    32     DOMString currencySystem = "urn:iso:std:iso:4217";
    3331};
  • trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp

    r228331 r232155  
    139139static ExceptionOr<void> checkAndCanonicalizeAmount(PaymentCurrencyAmount& amount)
    140140{
    141     if (amount.currencySystem != "urn:iso:std:iso:4217")
    142         return { };
    143 
    144141    if (!isWellFormedCurrencyCode(amount.currency))
    145142        return Exception { RangeError, makeString("\"", amount.currency, "\" is not a valid currency code.") };
     
    156153static ExceptionOr<void> checkAndCanonicalizeTotal(PaymentCurrencyAmount& total)
    157154{
    158     if (total.currencySystem != "urn:iso:std:iso:4217")
    159         return { };
    160 
    161155    auto exception = checkAndCanonicalizeAmount(total);
    162156    if (exception.hasException())
  • trunk/Source/WebCore/inspector/WebInjectedScriptHost.cpp

    r229410 r232155  
    8585    object->putDirect(vm, Identifier::fromString(exec, "currency"), jsString(exec, paymentCurrencyAmount.currency));
    8686    object->putDirect(vm, Identifier::fromString(exec, "value"), jsString(exec, paymentCurrencyAmount.value));
    87     object->putDirect(vm, Identifier::fromString(exec, "currencySystem"), jsString(exec, paymentCurrencyAmount.currencySystem));
    8887    return object;
    8988}
Note: See TracChangeset for help on using the changeset viewer.