diff --git a/dom/interfaces/payments/nsIPaymentRequest.idl b/dom/interfaces/payments/nsIPaymentRequest.idl index 78a10c1d08a9..8e47a933d753 100644 --- a/dom/interfaces/payments/nsIPaymentRequest.idl +++ b/dom/interfaces/payments/nsIPaymentRequest.idl @@ -30,7 +30,6 @@ interface nsIPaymentItem : nsISupports readonly attribute AString label; readonly attribute nsIPaymentCurrencyAmount amount; readonly attribute boolean pending; - readonly attribute AString type; }; [scriptable, builtinclass, uuid(74259861-c318-40e8-b3d5-518e701bed80)] diff --git a/dom/payments/PaymentRequestData.cpp b/dom/payments/PaymentRequestData.cpp index 536d7cd7ee80..725ea053932e 100644 --- a/dom/payments/PaymentRequestData.cpp +++ b/dom/payments/PaymentRequestData.cpp @@ -109,12 +109,10 @@ NS_IMPL_ISUPPORTS(PaymentItem, PaymentItem::PaymentItem(const nsAString& aLabel, nsIPaymentCurrencyAmount* aAmount, - const bool aPending, - const nsAString& aType) + const bool aPending) : mLabel(aLabel) , mAmount(aAmount) , mPending(aPending) - , mType(aType) { } @@ -129,7 +127,7 @@ PaymentItem::Create(const IPCPaymentItem& aIPCItem, nsIPaymentItem** aItem) return rv; } nsCOMPtr item = - new PaymentItem(aIPCItem.label(), amount, aIPCItem.pending(), aIPCItem.type()); + new PaymentItem(aIPCItem.label(), amount, aIPCItem.pending()); item.forget(aItem); return NS_OK; } @@ -159,13 +157,6 @@ PaymentItem::GetPending(bool* aPending) return NS_OK; } -NS_IMETHODIMP -PaymentItem::GetType(nsAString& aType) -{ - aType = mType; - return NS_OK; -} - /* PaymentDetailsModifier */ NS_IMPL_ISUPPORTS(PaymentDetailsModifier, diff --git a/dom/payments/PaymentRequestData.h b/dom/payments/PaymentRequestData.h index 400780634e47..7b609ebe03c1 100644 --- a/dom/payments/PaymentRequestData.h +++ b/dom/payments/PaymentRequestData.h @@ -65,15 +65,13 @@ public: private: PaymentItem(const nsAString& aLabel, nsIPaymentCurrencyAmount* aAmount, - const bool aPending, - const nsAString& aType); + const bool aPending); ~PaymentItem() = default; nsString mLabel; nsCOMPtr mAmount; bool mPending; - nsString mType; }; class PaymentDetailsModifier final : public nsIPaymentDetailsModifier diff --git a/dom/payments/PaymentRequestManager.cpp b/dom/payments/PaymentRequestManager.cpp index 1630aa4e6b7a..75f0767a75a4 100644 --- a/dom/payments/PaymentRequestManager.cpp +++ b/dom/payments/PaymentRequestManager.cpp @@ -51,18 +51,9 @@ ConvertCurrencyAmount(const PaymentCurrencyAmount& aAmount, void ConvertItem(const PaymentItem& aItem, IPCPaymentItem& aIPCItem) { - uint8_t typeIndex = UINT8_MAX; - if (aItem.mType.WasPassed()) { - typeIndex = static_cast(aItem.mType.Value()); - } - nsString type; - if (typeIndex < ArrayLength(PaymentItemTypeValues::strings)) { - type.AssignASCII( - PaymentItemTypeValues::strings[typeIndex].value); - } IPCPaymentCurrencyAmount amount; ConvertCurrencyAmount(aItem.mAmount, amount); - aIPCItem = IPCPaymentItem(aItem.mLabel, amount, aItem.mPending, type); + aIPCItem = IPCPaymentItem(aItem.mLabel, amount, aItem.mPending); } nsresult diff --git a/dom/payments/ipc/PPaymentRequest.ipdl b/dom/payments/ipc/PPaymentRequest.ipdl index a5782238f5c8..7c634e4fc037 100644 --- a/dom/payments/ipc/PPaymentRequest.ipdl +++ b/dom/payments/ipc/PPaymentRequest.ipdl @@ -27,7 +27,6 @@ struct IPCPaymentItem nsString label; IPCPaymentCurrencyAmount amount; bool pending; - nsString type; }; struct IPCPaymentDetailsModifier diff --git a/dom/payments/test/ConstructorChromeScript.js b/dom/payments/test/ConstructorChromeScript.js index 9ce4448db547..22e4cd472f3d 100644 --- a/dom/payments/test/ConstructorChromeScript.js +++ b/dom/payments/test/ConstructorChromeScript.js @@ -141,8 +141,8 @@ function checkComplexRequest(payRequest) { if (!details.displayItems) { emitTestFail("details.displayItems should not be undefined."); } - if (displayItems.length != 3) { - emitTestFail("displayItems' length should be 3.") + if (displayItems.length != 2) { + emitTestFail("displayItems' length should be 2.") } let item = displayItems.queryElementAt(0, Ci.nsIPaymentItem); if (item.label != "First item") { @@ -154,9 +154,6 @@ function checkComplexRequest(payRequest) { if (item.amount.value != "60.00") { emitTestFail("1st display item's value should be '60.00'."); } - if (item.type != "") { - emitTestFail("1st display item's type should be ''."); - } item = displayItems.queryElementAt(1, Ci.nsIPaymentItem); if (item.label != "Second item") { emitTestFail("2nd display item's label should be 'Second item'."); @@ -167,22 +164,6 @@ function checkComplexRequest(payRequest) { if (item.amount.value != "40.00") { emitTestFail("2nd display item's value should be '40.00'."); } - if (item.type != "") { - emitTestFail("2nd display item's type should be ''."); - } - item = displayItems.queryElementAt(2, Ci.nsIPaymentItem); - if (item.label != "Tax") { - emitTestFail("3rd display item's label should be 'Tax'."); - } - if (item.amount.currency != "USD") { - emitTestFail("3rd display item's currency should be 'USD'."); - } - if (item.amount.value != "5.00") { - emitTestFail("3rd display item's value should be '5.00'."); - } - if (item.type != "tax") { - emitTestFail("3rd display item's type should be 'tax'."); - } const modifiers = details.modifiers; if (!modifiers) { diff --git a/dom/payments/test/test_constructor.html b/dom/payments/test/test_constructor.html index 2fe0c1232203..1374bba47662 100644 --- a/dom/payments/test/test_constructor.html +++ b/dom/payments/test/test_constructor.html @@ -75,14 +75,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1345361 currency: "USD", value: "40.00" } - }, - { - label: "Tax", - amount: { - currency: "USD", - value: "5.00" - }, - type: "tax" } ], modifiers: [ diff --git a/dom/webidl/PaymentRequest.webidl b/dom/webidl/PaymentRequest.webidl index 2b2926945b36..212bbdc73a78 100644 --- a/dom/webidl/PaymentRequest.webidl +++ b/dom/webidl/PaymentRequest.webidl @@ -21,15 +21,10 @@ dictionary PaymentCurrencyAmount { DOMString currencySystem = "urn:iso:std:iso:4217"; }; -enum PaymentItemType { - "tax" -}; - dictionary PaymentItem { required DOMString label; required PaymentCurrencyAmount amount; boolean pending = false; - PaymentItemType type; }; dictionary PaymentShippingOption { diff --git a/testing/web-platform/meta/payment-request/PaymentItem/type_member.https.html.ini b/testing/web-platform/meta/payment-request/PaymentItem/type_member.https.html.ini deleted file mode 100644 index f8395f17ba6f..000000000000 --- a/testing/web-platform/meta/payment-request/PaymentItem/type_member.https.html.ini +++ /dev/null @@ -1,17 +0,0 @@ -[type_member.https.html] - [Smoke test] - expected: - if not e10s: FAIL - - [An invalid enum value for PaymentDetailsInit.total's type throws TypeError] - expected: - if not e10s: FAIL - - [Invalid enum value for PaymentItem.type member throws a TypeError] - expected: - if not e10s: FAIL - - [Valid enum values for PaymentItem.type member does not throw] - expected: - if not e10s: FAIL - diff --git a/testing/web-platform/tests/payment-request/PaymentItem/type_member.https.html b/testing/web-platform/tests/payment-request/PaymentItem/type_member.https.html deleted file mode 100644 index dc62a83f597a..000000000000 --- a/testing/web-platform/tests/payment-request/PaymentItem/type_member.https.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - PaymentItem type member - - - -