WebKit Bugzilla
Attachment 348833 Details for
Bug 189249
: [Payment Request] PaymentResponse should have an onpayerdetailchange event handler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189249-20180904113706.patch (text/plain), 7.99 KB, created by
Andy Estes
on 2018-09-04 11:37:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-09-04 11:37:06 PDT
Size:
7.99 KB
patch
obsolete
>Subversion Revision: 235621 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e85aec0944238162f1cfefadbf6009aab8da3a3d..f4fa4355cd6fedad8df1c3f78fb632a92dd52c03 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-09-04 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] PaymentResponse should have an onpayerdetailchange event handler >+ https://bugs.webkit.org/show_bug.cgi?id=189249 >+ >+ Reviewed by Alex Christensen. >+ >+ Implemented the onpayerdetailchange event handler as defined in the Payment Request API W3C Editor's Draft of 30 August 2018. >+ >+ The "payer detail changed" algorithm will be implemented in a follow-up patch. >+ >+ Covered by existing web platform tests. >+ >+ * Modules/paymentrequest/PaymentResponse.cpp: >+ (WebCore::PaymentResponse::scriptExecutionContext const): >+ * Modules/paymentrequest/PaymentResponse.h: >+ * Modules/paymentrequest/PaymentResponse.idl: >+ * dom/EventNames.h: >+ * dom/EventTargetFactory.in: >+ > 2018-09-04 Daniel Bates <dabates@apple.com> > > Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925) >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >index 63cf29d658890bd8e1f068d244777cee9aecd405..0f16d6f859ce30ba23cef6ed47bb413e5070e1ec 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -59,6 +59,11 @@ void PaymentResponse::retry(PaymentValidationErrors&&, DOMPromiseDeferred<void>& > promise.reject(Exception { NotSupportedError }); > } > >+ScriptExecutionContext* PaymentResponse::scriptExecutionContext() const >+{ >+ return static_cast<ActiveDOMObject&>(m_request.get()).scriptExecutionContext(); >+} >+ > } // namespace WebCore > > #endif // ENABLE(PAYMENT_REQUEST) >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >index e265ebc34fe584c548c0463dd0c06713f3942a1a..9609b8de9f8007b485a10365d5c2b0d683f8df32 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -27,6 +27,7 @@ > > #if ENABLE(PAYMENT_REQUEST) > >+#include "EventTarget.h" > #include "JSDOMPromiseDeferred.h" > #include "PaymentAddress.h" > #include "PaymentComplete.h" >@@ -37,7 +38,7 @@ class Document; > class PaymentRequest; > struct PaymentValidationErrors; > >-class PaymentResponse final : public RefCounted<PaymentResponse> { >+class PaymentResponse final : public RefCounted<PaymentResponse>, public EventTargetWithInlineData { > public: > static Ref<PaymentResponse> create(PaymentRequest& request) > { >@@ -73,9 +74,18 @@ public: > void complete(std::optional<PaymentComplete>&&, DOMPromiseDeferred<void>&&); > void retry(PaymentValidationErrors&&, DOMPromiseDeferred<void>&&); > >+ using RefCounted<PaymentResponse>::ref; >+ using RefCounted<PaymentResponse>::deref; >+ > private: > explicit PaymentResponse(PaymentRequest&); > >+ // EventTarget >+ EventTargetInterface eventTargetInterface() const final { return PaymentResponseEventTargetInterfaceType; } >+ ScriptExecutionContext* scriptExecutionContext() const final; >+ void refEventTarget() final { ref(); } >+ void derefEventTarget() final { deref(); } >+ > Ref<PaymentRequest> m_request; > String m_requestId; > String m_methodName; >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.idl b/Source/WebCore/Modules/paymentrequest/PaymentResponse.idl >index ae24519a781ec519c4fe2f2e6ca1e8d349973f52..7210dd84239e328c30d13e8e07f419c7b3cdd316 100644 >--- a/Source/WebCore/Modules/paymentrequest/PaymentResponse.idl >+++ b/Source/WebCore/Modules/paymentrequest/PaymentResponse.idl >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2017 Apple Inc. All rights reserved. >+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -26,9 +26,9 @@ > [ > Conditional=PAYMENT_REQUEST, > EnabledBySetting=PaymentRequest, >- ImplementationLacksVTable, >- SecureContext >-] interface PaymentResponse { >+ Exposed=Window, >+ SecureContext, >+] interface PaymentResponse : EventTarget { > serializer = { attribute }; > > readonly attribute DOMString requestId; >@@ -42,4 +42,6 @@ > > [NewObject] Promise<void> complete(optional PaymentComplete result = "unknown"); > [NewObject] Promise<void> retry(PaymentValidationErrors errorFields); >+ >+ attribute EventHandler onpayerdetailchange; > }; >diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h >index f70dc749afc800d2772f11464f6eeac611b1a158..8226ea8515390fc03d0031f0fd139c5e9248c81f 100644 >--- a/Source/WebCore/dom/EventNames.h >+++ b/Source/WebCore/dom/EventNames.h >@@ -189,6 +189,7 @@ namespace WebCore { > macro(pageshow) \ > macro(paste) \ > macro(pause) \ >+ macro(payerdetailchange) \ > macro(paymentauthorized) \ > macro(paymentmethodchange) \ > macro(paymentmethodselected) \ >diff --git a/Source/WebCore/dom/EventTargetFactory.in b/Source/WebCore/dom/EventTargetFactory.in >index 3ad9c32be72c231759b5dbb4b2edf8135d075db0..80626a88a139c50b7ac965f91b7eba9cfb9b582b 100644 >--- a/Source/WebCore/dom/EventTargetFactory.in >+++ b/Source/WebCore/dom/EventTargetFactory.in >@@ -29,6 +29,7 @@ Node > Notification conditional=NOTIFICATIONS > OffscreenCanvas > PaymentRequest conditional=PAYMENT_REQUEST >+PaymentResponse conditional=PAYMENT_REQUEST > Performance > RTCDataChannel conditional=WEB_RTC > RTCDTMFSender conditional=WEB_RTC_DTMF >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index e33449a3d041bd8f81395b29c624effca29e28d9..a2431597bc7b26310d43866f4a6989b5c3533d9a 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,12 @@ >+2018-09-04 Andy Estes <aestes@apple.com> >+ >+ [Payment Request] PaymentResponse should have an onpayerdetailchange event handler >+ https://bugs.webkit.org/show_bug.cgi?id=189249 >+ >+ Reviewed by Alex Christensen. >+ >+ * web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.https-expected.txt: >+ > 2018-09-03 Andy Estes <aestes@apple.com> > > [Payment Request] Implement the MerchantValidationEvent constructor >diff --git a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.https-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.https-expected.txt >index aa6653288bdc1d76d48cd63fc5abf9cf8f3d65d8..b9ad87c7a59500da378b49f524829e2d26ebb626 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.https-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/payment-request/payment-response/onpayerdetailchange-attribute.https-expected.txt >@@ -1,8 +1,4 @@ > >-FAIL PaymentResponse inherits from EventTarget assert_equals: expected function "function EventTarget() { >- [native code] >-}" but got function "function () { >- [native code] >-}" >-FAIL PaymentResponse has an onpayerdetailchange in the prototype chain assert_true: expected true got false >+PASS PaymentResponse inherits from EventTarget >+PASS PaymentResponse has an onpayerdetailchange in the prototype chain >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189249
:
348790
| 348833