Commit Graph

218 Commits

Author SHA1 Message Date
Eden Chuang
f4764c9019 Bug 1435161 - mochitest for PaymentResponse.retry(). r=baku
1. Add testcase testRetryAfterComplete to test the behavior of retry() after
       complete().
    2. Add testcase testRetryAfterRetry to test the multiple retry()s in the same
       round.
    3. Add testcase testRetryWithEmptyErrors to test the retry() called with an
       empty PaymentValidationErrors.
    4. Add testcase testRetry to test the normal flow of retry().
    5. Add testcase testRetryAbortByUser to test the retry() aborted by user.
2018-09-04 12:30:18 +02:00
Marcos Cáceres
ef9e5ae876 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku
--HG--
extra : rebase_source : d5f1590effbec2085672aa4a1552cbb798b4530b
2018-09-10 04:44:00 +03:00
Dorel Luca
f012e0b9a2 Backed out 2 changesets (bug 1487295) for WPT failres in payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html
Backed out changeset 33cb5cf879d8 (bug 1487295)
Backed out changeset b5657f72bcb0 (bug 1487295)
2018-09-07 12:50:07 +03:00
Marcos Cáceres
a4a6a91838 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku
--HG--
extra : amend_source : 160b5a164fff0faf5a137b0dd0c50c6d5d859740
2018-09-06 23:53:00 +03:00
Gurzau Raul
031bc0c262 Backed out changeset f7d509458e63 (bug 1487295) for failing at PaymentMethodChangeEvent/methodDetails-attribute.https.html on a CLOSED TREE 2018-09-04 21:18:53 +03:00
Marcos Cáceres
15c023f206 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku 2018-09-04 01:21:00 +03:00
Marcos Cáceres
8128af9850 Bug 1485881 - Drop support for PaymentAddress.languageCode r=smaug
--HG--
extra : rebase_source : 6400765c8b669126c7a71f5094dd160b2b1a89ce
2018-08-27 16:30:00 +03:00
Marcos Cáceres
1699f2bb63 Bug 1484864 - Intermittent tier 2 test-verify dom/payments/test/browser_payment_in_different_tabs.js r=edenchuang 2018-08-27 21:47:00 +03:00
Eden Chuang
2f8de0fe6b Bug 1483470 - Improve the test case for responding a closed PaymentRequest. r=baku
1. Improving the testCloseByRedirectingAfterShow. Try to call
       PaymentRequestService::respondPayment when the PaymentRequest is closed.
    2. Adding a new test testUpdateWithRespondedPayment for the case the merchant
       calls PaymentRequestUpdateEvent::updateWith() and the PaymentRequest is
       rejected by the user.

--HG--
rename : dom/payments/test/test_cleanupPayment.html => dom/payments/test/test_closePayment.html
2018-08-24 11:28:50 +02:00
Eden Chuang
a29e2c4da2 Bug 1483470 - Handling PaymentRequestUpdateEvent::updateWith() to a responed PaymentRequest. r=baku
1. Checking if the PaymentRequest::mState equals to eInteractive when calling
       PaymentRequest::UpdatePayment() and PaymentRequest::AbortUpdate.
    2. Removing the non-suitable MOZ_ASSERT in PaymentRequest::RespondShowPayment()
2018-08-22 03:10:45 +02:00
Eden Chuang
6fddec41b3 Bug 1483470 - Adding new method closePayment in nsIPaymentUIService.idl. r=baku
1. Adding a new method void closePayment(in AString requestId) in
       nsIPaymentUIService.idl
    2. Implementing the closePayment method in paymentUIService.js.
    3. Calling closePayment of paymentUIService.js in
       PaymentRequestService::LaunchUIAction()
2018-08-16 14:19:35 +02:00
Eden Chuang
68bb5bfa3c Bug 1483470 - Handling PaymentRequestService::RespondPayment() to a closed PaymentRequest. r=baku
1. Returning NS_ERROR_FAILURE in PaymentRequestService::RespondPayment() when
       the specified PaymentRequest does not exist in PaymentRequestService.
    2. Renaming "cleanup" to "close" in DOM::WebPayment codes to fit the actual
       behavior.
2018-08-16 14:27:24 +02:00
Kris Maglione
3a5c05e76f Bug 1484496: Part 5e - Convert remaining nsISimpleEnumerator users to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D3733

--HG--
extra : rebase_source : c0fac176d7b3d840c4dbb14f8d95ccfc7f83a5a8
extra : histedit_source : a92c40117d0808a3ad68c972f622a7a42c9ae8ba
2018-08-18 18:13:14 -07:00
Kris Maglione
2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.

Differential Revision: https://phabricator.services.mozilla.com/D3728

--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
2018-08-18 21:06:32 -07:00
Kris Maglione
65c28aa0ad Bug 1484496: Part 2 - Add common base class for all nsISimpleEnumerator implementations. r=froydnj
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.

This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.

Differential Revision: https://phabricator.services.mozilla.com/D3725

--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
2018-08-18 14:22:47 -07:00
Marcos Cáceres
d9c9ac71d9 Bug 1483156 - Currency of PaymentItem total should be 'USD', but got BOB r=edenchuang
--HG--
extra : amend_source : 8bfb03ef649733c587b1b04bfea6260fb5b2b4fd
2018-08-21 20:16:00 +03:00
Jeff Walden
e4f79e2a19 Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem 2018-08-20 07:54:45 -07:00
Marcos Cáceres
8f0ff24be1 Bug 1480872 - paymentDetails attributes should default to an empty arrays. r=edenchuang 2018-08-19 19:11:00 +03:00
Eden Chuang
d532620f01 Bug 1408234 - mochitest for PaymentRequest cleanup after document closed. r=baku
1. add a set new mochitests to test cleanup function.
       By redirecting to another page.
       By redirecting to another page, when PaymentRequest.show() is called.
       By reloading
       By removing/closing the page.
    2. remove unnecessary PaymentRequestService.cleanup() call in the test suite.
2018-08-13 11:25:13 +02:00
Eden Chuang
b4cd2e70aa Bug 1408234 - Cleanup the PaymentRequests when document close. r=baku
Let PaymentRequest inherit from nsIDocumentActivity interface.
    Calling RegisterActivityObserver() and UnregisterActivityObserver() in
    constructor and destructor to get activity notifications from document.
    When receiving the notification, NotifyOwnerDocumentActivityChanged() will
    check the owner document's activity status. If the status is disabled, calling
    PaymentRequestManager::CleanupPayment() to cleanup the PaymentRequest in
    content process and aslo sending the cleanup information to chrome process.
2018-08-13 11:24:54 +02:00
Zibi Braniecki
4432035f49 Bug 1480673 - Migrate all uses of JS_Stringify to nsContentUtils::StringifyJSON. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D2701

--HG--
extra : moz-landing-system : lando
2018-08-07 16:01:27 +00:00
Marcos Cáceres
923fe8871a Bug 1497110 - remove currencySystem from PaymentRequest. r=edenchuang, peterv
--HG--
extra : amend_source : 2806c93a6cbab54261e9176f3f6426acdf28eb89
2018-10-07 21:00:00 +03:00
Andi-Bogdan Postelnicu
88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Marcos Cáceres
60e5daf61c Bug 1468356 - Implement onpaymentmethodchange attribute. r=mrbkap
--HG--
extra : rebase_source : 220c160ce0a4ab0568285c276de7326d4a16da23
2018-06-30 10:11:00 +03:00
Dorel Luca
bc2fbd0648 Merge mozilla-central to autoland
--HG--
extra : rebase_source : 0f5c3c308ce6ddd6fb9fcb49b83d4450a24d67dc
2018-06-27 13:33:04 +03:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Henri Sivonen
77eaf92c58 Bug 1447773 - Time out PaymentResponse after 5 seconds. r=mrbkap
MozReview-Commit-ID: JnoKgLC6yL6

--HG--
extra : rebase_source : 8fb0f553409b1ecf142568146f3f4cc7ad33ac4f
2018-05-29 12:31:22 +03:00
Sebastian Hengst
b8ce168b05 Bug 1471255 - bugs in dom/payments should be filed in Core::DOM: Web Payments. r=MattN
MozReview-Commit-ID: LuQsheIcW48

--HG--
extra : rebase_source : f00a112dfbf7992bfe32f18f89559fa02a915bae
2018-06-26 18:44:17 +03:00
Sebastian Hengst
c6864ae376 Bug 1470750 - Don't run DOM payment tests for non-Nightly. r=mrbkap
MozReview-Commit-ID: DqaSGheG7LE
2018-06-25 01:50:40 +03:00
Blake Kaplan
37c3abfe24 Bug 1470110 - Consistently disable payments off of Nightly. r=MattN
We only build the frontend parts of Web Payments on Nightly, but users could
futz with the prefs and expose the DOM API on Beta. We should be careful about
not allowing that mismatch.

This also adds some additional logging if we run into a bug like this again.

MozReview-Commit-ID: 9qcQTIsIHkg

--HG--
extra : rebase_source : cdaed71d79e6f8cedd1229ffd03cac21e3660367
2018-06-22 12:05:36 -07:00
Blake Kaplan
7616406bb3 Bug 1469433 - Remove an unused function. r=smaug
This was just sitting around.

MozReview-Commit-ID: 282neafD23x

--HG--
extra : rebase_source : 9f7257f9bebc8e063dd2ef2aca9bf0fa9c8300c0
2018-06-19 15:58:37 -07:00
Blake Kaplan
2597785450 Bug 1469433 - Handle shutdown more gracefully. r=smaug
If we end up shutting down the content process while there's a request active
we'll end up "leaking" the request and asserting. This makes sure that we
let go of the PaymentRequest in that edge case. I can cause this by forceably
closing the payment request window on Linux without hitting OK or cancel.

MozReview-Commit-ID: 6XDYIcqNkC6

--HG--
extra : rebase_source : d20d8fae4aa4fc3afcca8491d415c64b8af8bcb4
2018-06-19 15:55:32 -07:00
Blake Kaplan
5d09eec7de Bug 1469433 - Match the spec's error reporting more closely. r=smaug
MozReview-Commit-ID: LI13cA0okeu

--HG--
extra : rebase_source : 8ffb8db4fc0e4905f31cca2b41a954b89720e42a
2018-06-19 15:30:43 -07:00
Blake Kaplan
dfb2d7b714 Bug 1442453 - Pass objects around instead of string IDs in the child. r=baku
The existing code only passed strings around to identify PaymentRequest
objects. That meant that we were constantly having to do hashtable lookups to
find the corresponding object. This patch just uses the single map that IPDL
maintains for us and passes objects around, obviating the need for more
hashtable lookups.

MozReview-Commit-ID: 6BBonrc6q4x

--HG--
extra : rebase_source : 041c6ce742d60a2c9e954a58582d09cd9ef7f2b1
2018-05-31 16:20:51 -07:00
Blake Kaplan
49d7053a3e Bug 1442453 - Create a single IPC actor per PaymentRequest. r=baku
There isn't any need to create an actor per call to the parent. This patch
lines up PaymentRequest with PPaymentRequestChild objects and links them
together. It also simplifies the maps and arrays we use to keep track of these
objects.

There's one tricky bit to note in this patch: in the case that a promise is
passed to paymentRequest.show(), we don't notify the parent process until the
promise resolves (when we call either UpdatePayment or AbortUpdate). In that
case, I needed to distinguish between an "update" because of the promise
resolving or a call to updateWith on an shippingaddresschange event in order
to get the bookkeeping right with the mActivePayments hashtable. In that case,
the PaymentRequest is kept alive by mShowingRequest alone. In all other cases,
mActivePayments keeps the PaymentRequest alive until we resolve or reject the
correct promise.

MozReview-Commit-ID: HoHjn8eqC4T

--HG--
extra : rebase_source : 4da1d65d1f791f4a5c18871ab3a3dcf94e833b90
2018-05-31 13:30:29 -07:00
Blake Kaplan
40ee64ba85 Bug 1442453 - Fix nits and get rid of needless QIs. r=baku
This removes some hard tabs that crept in and combines two if branches into a
single statement in order to avoid a bit of duplication.

The existing code here seems to treat any sort of upcast as needing a QI. That
is needlessly wasteful and causes a bunch of unneeded virtual calls.

MozReview-Commit-ID: 7WshYm9C4Xb

--HG--
extra : rebase_source : bc7b1b5157324158f627efd8dff54f078488f4fc
2018-05-30 14:13:07 -07:00
Blake Kaplan
5251fffd6b Bug 1442453 - Fix a typo in this member name. r=baku
MozReview-Commit-ID: Ds7yRFn04NK

--HG--
extra : rebase_source : 76fbce0f2599dec30f6a07bb7044e5446abcbf65
2018-05-30 14:05:42 -07:00
Blake Kaplan
b1a13228be Bug 1442453 - Don't enforce "one interactive request" in the wrong place. r=baku
The existing code assumed that the only reason that there could be a
PaymentRequestChild was due to an active show() call. That is not the case. We
already know whether there's an "interactive" PaymentRequest through
mShowingRequest, so we should just use that instead.

MozReview-Commit-ID: IA9bXn7hS63

--HG--
extra : rebase_source : 0d65a6e05d224a5fddfdbb953ad28f2eecd80533
2018-05-30 14:04:32 -07:00
Joel Maher
50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Eden Chuang
130e426839 Bug 1435157 - mochitest for AddressErrors in WebPayment. r=baku
--HG--
extra : rebase_source : e1a782bab18fede5fe12e91ff26f1dd3037ccee2
2018-05-18 14:40:34 +08:00
Eden Chuang
029423a6e2 Bug 1435157 - Support AddressErrors in WebPayment. r=baku.
1. Add AddressErrors in PaymentRequest.webidl.
    2. IPC for passing AddressErrors.
    3. Getters for AddressErrors in nsIPaymentDetails.

--HG--
extra : rebase_source : 64c57003d57e064b5284cc64447c0c0740f16121
2018-05-17 19:59:16 +08:00
YUKI "Piro" Hiroshi
dd7b3aab39 Bug 1457395 - Fix typo "proces" in comments. r=milan
--HG--
extra : amend_source : 36cf036803ff9bffaebb66fc31ff7b960f0c7509
2018-05-10 16:56:09 +09:00
Kris Maglione
a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Eden Chuang
0471b5e543 Bug 1440041 - mochitest for nsIPaymentRequest.shippingOption. r=baku
This patch includes followings
    1. Test with no selected shipping options.
    2. Test with one selected shipping option when creating PaymentRequest.
    3. Test with multiple selected shipping options when creating PaymentRequest.
    4. Test with selecting shipping option by user.
    5. Test with modifying the user selection by merchant.
    6. Merges the mochitest for bug 1443914.

--HG--
rename : dom/payments/test/Bug1443914ChromeScript.js => dom/payments/test/ShippingOptionsChromeScript.js
rename : dom/payments/test/test_bug1443914.html => dom/payments/test/test_shippingOptions.html
extra : histedit_source : 19126dcb3870e0637ed8f4d0fbc6839cb5d682a0
2018-04-13 18:48:31 -07:00
Eden Chuang
b206167b93 Bug 1440041 - Add a new readonly attribute nsIPaymentRequest.shippingOption. r=baku. 2018-04-13 18:47:20 -07:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Boris Zbarsky
4292bca4ee Bug 1449631 part 6. Remove nsIDOMEventTarget::DispatchEvent. r=smaug
MozReview-Commit-ID: 8YMgmMwZkAL
2018-04-05 13:42:41 -04:00
Eden Chuang
2c1de92a07 Bug 1441709 - Mochitest for PaymentRequest.show(optional Promise<PaymentDetailsUpdate> detailsPromise). r=baku
1. Add testShowWithXXX tests to test PaymentRequest.show() with
   PaymentDetailsUpdate promise.
2. Improve the test case implementation by removing the redundant code.

--HG--
extra : histedit_source : 9c68ba8eb6ea4db7e6a158baf19f170b5736a9db
2018-03-30 22:42:38 +08:00
Eden Chuang
1537e9d304 Bug 1441709 - Support PaymentRequest.show() with an optional PaymentDetailsUpdate promise parameter. r=baku
1. Add "optional Promise<PaymentDetailsUpdate> detailsPromise" as a parameter
   of PaymentRequest.show() in PaymentRequest.webidl.
2. Let PaymentRequest inherit from PromiseNativeHandler, and implement the
   ResolvedCallback() and RejectedCallback() to handle the PaymentDetailsUpdate
   promise.
3. Update PaymentRequest.show() implementation. If PaymentDetailsUpdate Promise
   is not nullptr, the show request would not be transferred to chrome process
   immediately until the promise is resolved/rejected.
4. Update selectedShippingOption when requestShipping is true.
5. Change the PaymentMethod id validation sequence according to the spec.

--HG--
extra : histedit_source : e591c759037cce4f66701b2faa5ecbe01c00e246
2018-04-02 23:12:21 +08:00
Eden Chuang
c0b77a99d3 Bug 1443914 - Mochitest for force updating PaymentDetails. r=baku
--HG--
extra : histedit_source : e2905ede4132942e43045f377dd8fe7ca364c626
2018-03-29 23:10:08 +08:00
Eden Chuang
1ec4751b5b Bug 1443914 - Force updating PaymentDetails when requestShipping is true. r=baku
Update the implementation according to the spec update.
Force updating the saved PaymentDetails when requestShipping is true, even
the data(shippingOptions) doesn't present in the DetailsUpdate.

--HG--
extra : histedit_source : b0a1c0b9cc7efe045ce330432b60bb6f86eb1878
2018-03-29 23:09:52 +08:00
Jonathan Guillotte-Blouin
673331c9c5 Bug 1442078 - Modify DOM tests that were broken by the change to the "show" specs. r=baku
MozReview-Commit-ID: KqecbNw496W

--HG--
extra : rebase_source : 4c6a120183286e52243356a74b3fdf522ca09c2b
2018-03-08 22:41:30 -05:00
Jonathan Guillotte-Blouin
d02a6dc311 Bug 1442078 - throw "SecurityError" if show is not triggered by user activation. r=baku
MozReview-Commit-ID: 73gP1iJAvhf

--HG--
extra : rebase_source : 90c1cae77b2d7a15f856abdaf5bb58ab73d5c915
2018-03-02 16:17:45 -05:00
Jared Wein
3fa24ba667 Bug 1441683 - response.complete() should make the completeStatus available to the payment UI service. r=baku
MozReview-Commit-ID: TnszpuqAa

--HG--
extra : rebase_source : 81c53e6db13c49f85c1716598107c06129ec8d21
2018-03-13 10:30:08 -04:00
Henri Sivonen
2eb6c4eda3 Bug 1436903 - Avoid passing shipping options to the front end when shipping was not requested. r=baku
MozReview-Commit-ID: FdkC02izUy6

--HG--
extra : rebase_source : 4434a148379e33771950848c6cdf1350e33eb23b
2018-03-07 13:16:46 +02:00
Henri Sivonen
707e82855c Bug 1435155 - Redact the shipping address as it is visible before the promise from PaymentRequest.show() resolves successfully. r=baku
Spec PR: https://github.com/w3c/payment-request/pull/654

MozReview-Commit-ID: 2AiKI7htRhk

--HG--
extra : rebase_source : 3a1e41f8322424f1e57a5887d2d87862e609165d
2018-03-07 09:39:08 +02:00
Andreea Pavel
dc797492f3 Backed out changeset 8a29a154e88d (bug 1435155) for browser chrome leakchecks (APZEventState, ActiveElementManager, Array, AsyncFreeSnowWhite, AsyncLatencyLogger, ...) on a CLOSED TREE 2018-03-07 18:19:29 +02:00
Henri Sivonen
a4da46bb89 Bug 1435155 - Redact the shipping address as it is visible before the promise from PaymentRequest.show() resolves successfully. r=baku
Spec PR: https://github.com/w3c/payment-request/pull/654

MozReview-Commit-ID: 2AiKI7htRhk

--HG--
extra : rebase_source : 77ea27abe066bd62a0ac84f52731fa52ea938b73
2018-03-07 09:39:08 +02:00
Henri Sivonen
44e4383f36 Bug 1432079 - Implement PaymentItemType. r=baku
MozReview-Commit-ID: Jpj9arQ9MaE

--HG--
extra : rebase_source : 75dff1a752b2f85b162e6cfbc67fd563cee12993
2018-02-28 15:00:05 +02:00
Andrew McCreight
5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Cameron McCormack
d02e54b79b Bug 1430014 - Part 5: Stop building old style system classes when MOZ_OLD_STYLE is not defined. r=xidorn
MozReview-Commit-ID: CIHyPdF7Exl

--HG--
extra : source : 78a2fc781eead47af3923efcde58569c5d882ab1
2018-02-01 15:04:04 +11:00
Kris Maglione
918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou
9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian
af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Eden Chuang
6b14fc7125 Bug 1403079 - Add mAllowPaymentRequest and related methods on nsIDocument to check if PaymentRequest API is allowed to use. r=smaug
Add a new member mAllowPaymentRequest on nsIDocument and following related
methods,
  bool AllowPaymentRequest() const
  void SetAllowPaymentRequest(bool aAllowPaymentRequest)
mAllowPaymentRequest is used to check if PaymentRequest is allowed to use on
the document. According to the spec
  https://html.spec.whatwg.org/multipage/iframe-embed-object.html#allowed-to-use
the mAllowPaymentRequest should be true under following situations
  1. The document is the top level content document.
  2. The document is the same origin with its parent document and its parent
     document's mAllowPaymentRequest is true.
  3. The document is different origin with its parent document but its
     parent node is an iframe with allowpaymentrequest flag and the parent
     document's mAllowPaymentRquest is true.

This patch also include following mochitests
  1. test for allowpaymentrequest flag changing. The flag change effect should
     not be applied to the document immediately, it should be updated while
     the browsing context is updated.
  2. test for effect propagation in the nested iframe.
2017-10-19 15:56:51 +08:00
Andrew McCreight
298aa82710 Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL

--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
2017-10-26 15:08:41 -07:00
Eden Chuang
8eaa630afe Bug 1408250 - Don't expose PaymentRequest API in non-e10s. r=baku
1. PaymentRequest::PrefEnabled() returns false under non-e10s situation.
2. Add a new mochitest test_block_none10s.html to expect to get ReferenceError
   in non-e10s mode.
2017-10-20 00:10:25 +08:00
Masatoshi Kimura
dbd92543c6 Bug 1313150 - Remove |weak| parameter from nsIMutableArray methods. r=froydnj
MozReview-Commit-ID: 7JoD4VYzZp3

--HG--
extra : rebase_source : 5db437f1c34608aa223916874d62b48c59baeae8
2017-10-21 23:53:02 +09:00
Eden Chuang
3d2f4c7cfc Bug 1403080 - Return null DOMString while PaymentOptions.requestShipping is false. r=baku
--HG--
extra : rebase_source : ec5f87928253c69d834f2a7a9a0c9b3b1f523c45
2017-09-28 15:20:19 +08:00
Eden Chuang
f04fc2e524 Bug 1389418 - Mochitest for payment method identifier validation support in PaymentRequest API. r=baku
1. Test PaymentRequest construction with valid PMIs.
2. Test PaymentRequest construction with Invalid PMIs.
3. Test PaymentRequestUpdateEvent::updateWith with a valid PMI.
4. Test PaymentRequestUpdateEvent::updateWith with a invalid PMI.

Remove unnecessary html tags in html files.
2017-09-11 11:10:10 +08:00
Eden Chuang
150de62804 Bug 1389418 - Support payment method identifier validation in PaymentRequest API. r=baku
This patch implements payment method identifier validation algorithm
according to the spec https://w3c.github.io/payment-method-id/.

The steps to validate a payment method identifier with a string pmi are
given by the following algorithm. It returns true if the pmi is valid.

1. Let url be the result of running the basic URL parser with pmi.
2. If url is failure, validate a standardized payment method identifier with
   pmi and return the result.
3. Otherwise, validate a URL-based payment method identifier passing url and
   return the result.
2017-09-11 09:52:24 +08:00
Eden Chuang
62b089b5ed Bug 1398991 - Mochitest for spec change on PaymentRequest.shippingOption. r=baku
This patch changes the test_construction.html with following modification.
1. Modify the test testWithDuplicateShippingOptionsParameters to expect a
   TypeError when constructing wiht duplicate shippingOption ids.
2. Add test testShippingOtpionAttribute for shippingOption setting checking
   with following conditions
   1. No selected shippingOption and PaymentOptions.requestShipping is false
   2. One selected shippingOption and PaymentOptions.requestShipping is false
   3. One selected shippingOption and PaymentOptions.requestShipping is true
   4. Multiple selected shippingOptions and PaymentOptions.requestShipping is
      true.
2017-09-15 14:20:05 +08:00
Eden Chuang
a15d19dc9d Bug 1398991 - Set PaymentRequest.ShippingOption only if options.requestShipping is true. r=baku
This patch implements the following changes according to the spec change.
See https://w3c.github.io/payment-request/#constructor step 8 for more
details.

1. Return TypeError during PaymentRequest construction with duplicate
   shippingOption id.
2. Set PaymentRequest.shippingOption with the selected shippingOption only
   if options.requestShipping is true.
2017-09-15 14:19:52 +08:00
Eden Chuang
066f794bbc Bug 1388661 - Mochitest for PaymentRequest API currency amount validation. r=baku
1. Create a new test test_currency_amount_validation.html to test validation
       with following scenarios
       * test with well formed currency codes.
       * test with invalid currency codes.
       * test with valid lower case currency codes and check is it converted to
         upper case.
       * test with invalid currency codes while calling
         PaymentRequestUpdateEvent::updateWith().
       * test with invalid amount value with calling
         PaymentRequestUpdateEvent::updateWith().
    2. Move tests of test_validate_decimal_value.html to
       test_currency_amount_validation.html
2017-09-06 14:38:33 +08:00
Eden Chuang
2638e37728 Bug 1388661 - Support currency validation in PaymentRequet API. r=baku
This patch implements currency validation algorithm according to the spec
    https://w3c.github.io/payment-request/#validity-checkers.

    1. amount.currencySystem must be "urn:iso:std:iso:4217".
    2. amount.currency is valid with following criteria
       1. The currency length must be 3.
       2. The currency contains any character that must be in the range "A" to
          "Z"(U+0041 to U+005A) or the range "a" to "z"(U+0061 to U+007A).

    According to the spec, converting the currency to upper case and save it in
    nsIPaymentRequest.
2017-09-06 14:36:24 +08:00
Andrew McCreight
78807d8776 Bug 1391005 - Eliminate NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED. r=peterv
Replace it with NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION, because it
has been the same for a while.

MozReview-Commit-ID: 5agRGFyUry1

--HG--
extra : rebase_source : 5388c56b2f6905c6ef969150f0c5b77bf247624d
2017-08-29 16:02:48 -07:00
Eden Chuang
e87f1be933 Bug 1385187 - Mochitest for rejecting PaymentRequest.show() with NotSupportedError DOMException if no supported method. r=baku
Adding a new test testCannotMakePaymentShow() to test the implementation.
2017-08-21 11:35:58 +08:00
Eden Chuang
af95d86b7f Bug 1385187 - Reject PaymentRequest.show() with NotSupportedError DOMException if no supported method. r=baku
1. Create a new action response status PAYMENT_NOTSUPPORTED and get rid of
   unnecessary method isAccpeted() from nsIPaymentActionResponse.idl.
2. Create canMakePayment() in PaymentRequestService and run it before
   launching UI. If canMakePayment() returns false, send PAYMENT_NOTSUPPORTED
   back to content process.
3. If chrome process returns PAYMENT_NOTSUPPORTED when calling showPayment(),
   throw NotSupportedError DOMException to merchant side.
2017-08-28 11:55:59 +08:00
Eden Chuang
608ad8a775 Bug 1387385 - Remove all nsIJSON usage in PaymentRequestUtils.cpp. r=baku
Instead of using nsIJSON, directly calling JS_Stringify and JS_ParseJSON for
JSON object serialization/deserialization.
2017-08-09 17:25:02 +08:00
Eden Chuang
283e59c25e Bug 1383293 - Mochitest for testing the new readonly attribute topLevelPrincipal in nsIPaymentRequest. r=baku
1. Adding new checks in ConstructorChromeScript.js to checking the top level
   document's principal information.
2. Adding a new test testCrossOriginTopLevelPrincipal in
   test_constructor.html to testing the topLevelPrincipal attribute under
   cross origin situation.
3. Removing some useless mochitest browser-chrome testcase.
2017-08-23 15:23:18 +08:00
Eden Chuang
34196fb87f Bug 1383293 - Add a new readonly attribute topLevelPrincipal in nsIPaymentRequest for UI support. r=baku
Getting the top level document's principal when constructing PaymentRequest,
then sending it to chrome process and saving it in nsIPaymentRequest.
Creating a new readonly attribute nsIPrincipal topLevelPrincipal in
nsIPaymentRequest for UI to query the top level document's principal
information.
2017-08-23 14:26:51 +08:00
Eden Chuang
97081209f0 Bug 1390737 - Run test_canMakePayment.html in nightly build only because it depends on nightly only UI service. r=btian 2017-08-16 12:53:25 +08:00
Eden Chuang
d66800c204 Bug 1390018 - Build and test Payments UI code on Nightly builds only. r=MattN
--HG--
extra : source : 8df491f3dcdfa4430bccac3242ee9cfb9fa3634b
2017-08-16 07:16:25 +08:00
Ryan VanderMeulen
629d98cad7 Backed out changeset 8df491f3dcdf for landing with the wrong bug number in the commit message. 2017-08-15 19:27:16 -04:00
Eden Chuang
a86c240986 Bug 1380018 - Build and test Payments UI code on Nightly builds only. r=MattN
--HG--
extra : rebase_source : 50f99532eefea866b67c7455dab4e430a9f09dfa
2017-08-16 07:16:25 +08:00
Masatoshi Kimura
dec070e4cf Bug 1389460 - Remove @deprecated nsIDOMEventTarget.DispatchDOMEvent. r=smaug
MozReview-Commit-ID: E88DZK5sfwx

--HG--
extra : rebase_source : 64e1a47c9366a970f20ec459dde9b379a207e802
2017-08-07 02:28:52 +09:00
Sebastian Hengst
b3269bec34 Backed out changeset 685802013f43 (bug 1389460) for OS X bustage at widget/cocoa/nsMenuX.mm:364: no member named 'DispatchDOMEvent' in 'nsIContent'. r=backout 2017-08-11 17:46:42 +02:00
Masatoshi Kimura
58d29db70b Bug 1389460 - Remove @deprecated nsIDOMEventTarget.DispatchDOMEvent. r=smaug
MozReview-Commit-ID: E88DZK5sfwx

--HG--
extra : rebase_source : 63300d87c0496394d3f75cb76bc47c75d640d369
2017-08-07 02:28:52 +09:00
Eden Chuang
0e6944b975 Bug 1382092 - Mochitest for supporting default payment UI in DOM code. r=baku
--HG--
extra : rebase_source : 0323538ef3a6e102d7af9f1bdab7f8fea63fd096
2017-07-24 17:18:27 +08:00
Eden Chuang
1bc5cd0145 Bug 1382092 - Support default payment UI service in DOM code part 2. r=baku
--HG--
extra : rebase_source : e0ac34360b83bd5929063ae1dd9616f4071f025e
2017-08-04 17:24:59 +08:00
Eden Chuang
fd842f1863 Bug 1375345 - Mochitests for basic card payment implementation. r=baku
--HG--
extra : rebase_source : 7a995f0276950af7b2dda2b3a5ea53e7174831a4
2017-07-24 17:17:03 +08:00
Eden Chuang
4a1f15b449 Bug 1375345 - Basic card payment implementation. r=baku
--HG--
extra : rebase_source : d581a1e117bdfc041940911487187620c5ed35ff
2017-07-26 16:07:07 +08:00
Eden Chuang
3aa4930b7a Bug 1379892 - Reject PaymentRequest.show() with AbortError DOMException if a request is showing. r=baku 2017-07-25 15:39:39 +08:00
Alphan Chen
126b75ecd5 Bug 1318988 - Implement allowPaymentRequest on iframe. r=baku
--HG--
extra : rebase_source : 976b3449ec72d01004323706414e3b26c653aaec
2017-07-18 10:16:28 +08:00
btian
c150a6ca01 Bug 1379925 - Part 2: Revise method |updateWith| based on spec change. r=baku
MozReview-Commit-ID: FpTGFlMvl0S
2017-07-14 09:56:33 +08:00
btian
68dea23805 Bug 1379925 - Part 1: Set PaymentRequestUpdateEvent.mRequest only when event target is a PaymentRequest. r=baku
MozReview-Commit-ID: AW9SDdL2uAd
2017-07-14 14:58:27 +08:00
btian
b484c82423 Bug 1380552 - Do not override method |IsTrusted| in PaymentRequestUpdateEvent. r=baku
MozReview-Commit-ID: C1DoziVe6F0
2017-07-13 11:48:58 +08:00
btian
afe249ca70 Bug 1380211 - Remove {} from generated id of payment request. r=baku
MozReview-Commit-ID: CtGHqxkk8X8
2017-07-12 09:24:07 +08:00
Jocelyn Liu
ffb43e0faf Bug 1367694 - Mochitest for resetting details.shippingOptions when there are duplicate option IDs. r=baku 2017-07-05 15:16:47 -07:00
Jocelyn Liu
809522fb3a Bug 1367694 - Set payment request's shippingOption and shippingType attributes when creating it. r=baku
Per spec, given details and options parameters of PaymentRequest constructor,
1) if details.shippingOptions exists and IDs of all shipping options are unique,
   request's shippingOption will be set to the last selected option's ID.
   Otherwise, set request's shippingOption to null.
2) if options.requestShipping is ture, set request's shippingType to
   options.shippingType. Otherwise, set request's shippingType to null.
2017-07-05 15:16:43 -07:00
Eden Chuang
c3f02d3246 Bug 1376623 - PaymentMethodData.supportedMethods is now DOMString. r=baku 2017-07-01 01:17:12 +08:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Eden Chuang
0a91438f97 Bug 1318990 - Mochitest for PaymentRequestUpdateEvent and PaymentRequest API show(). r=baku 2017-06-23 17:15:58 +08:00
Eden Chuang
4282643952 Bug 1318990 - PaymentRequestUpdateEvent interface and PaymentRequest API onshippingaddress/optionchange implementation. r=baku 2017-06-23 17:15:51 +08:00
Alphan Chen
7836b08caf Bug 1367669 - [PaymentRequest API] Mochitest for validate a decimal monetary value. r=baku 2017-06-21 15:37:54 +08:00
Alphan Chen
b89ef45eed Bug 1367669 - [PaymentRequest API] Revise the way to validate a decimal monetary value. r=baku 2017-06-21 13:23:24 +08:00
Florian Quèze
66f6d259bc Bug 1374282 - script generated patch to remove Task.jsm calls, r=Mossop. 2017-06-22 12:51:42 +02:00
Eden Chuang
332643e391 Bug 1345365 - Mochitest for PaymentRequest API canMakePayment() and abort(). r=baku
--HG--
extra : rebase_source : 9bac1eb8459104dd398f655d46f4c197d763d9ca
2017-06-13 14:43:18 +08:00
Eden Chuang
084d3f703e Bug 1345365 - PaymentRequest API canMakePayment(), abort() and show() implementation. r=baku
--HG--
extra : rebase_source : 09ea762ee2af888f090817617545c7cf7a15f1a9
2017-06-14 15:59:00 +08:00
Wes Kocher
1c6a87f4be Backed out 2 changesets (bug 1345365) for frequent failures in test_data.html a=backout
Backed out changeset 0ea7a5deacf6 (bug 1345365)
Backed out changeset bba1dee06769 (bug 1345365)

MozReview-Commit-ID: KURUgnesr8B
2017-06-15 00:52:04 -07:00
Eden Chuang
f9257bbf5b Bug 1345365 - Mochitest for PaymentRequest API canMakePayment() and abort(). r=baku
--HG--
extra : rebase_source : 854f2a94f2951f979c9bf5173c39c8fc1c11555c
2017-06-13 14:43:18 +08:00
Eden Chuang
5b3b71aae6 Bug 1345365 - PaymentRequest API canMakePayment(), abort() and show() implementation. r=baku
--HG--
extra : rebase_source : 1471c9b98cd919d411b22426c55bc3159d4d2f00
2017-06-14 15:59:00 +08:00
Eden Chuang
68cf4559f8 Bug 1345361 - PaymentRequest constructor implementation. r=baku 2017-05-26 01:50:32 +08:00
Ryan VanderMeulen
df9dd3967c Backed out changeset 437d6df1859c (bug 1345361) for ESLint failures. 2017-05-25 18:05:15 -04:00
Eden Chuang
80717194b1 Bug 1345361 - PaymentRequest constructor implementation. r=baku 2017-05-26 01:50:32 +08:00