WebKit Bugzilla
Attachment 348790 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-20180903135705.patch (text/plain), 7.81 KB, created by
Andy Estes
on 2018-09-03 13:57:08 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Andy Estes
Created:
2018-09-03 13:57:08 PDT
Size:
7.81 KB
patch
obsolete
>Subversion Revision: 235600 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 52544211ce30a096636aa4bf5f737b6efc01acb4..9beb05d9eb9447d4dea4e3c5260c737c4f8c5409 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-09-03 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 NOBODY (OOPS!). >+ >+ 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-03 Andy Estes <aestes@apple.com> > > [Payment Request] Implement the MerchantValidationEvent constructor >diff --git a/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp b/Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp >index 2aeaedf0b588b63866d1f19d9551057165742037..4dbf454976b83122765500e794f2d0e8b0e7213b 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 >@@ -52,6 +52,11 @@ void PaymentResponse::complete(std::optional<PaymentComplete>&& result, DOMPromi > promise.resolve(); > } > >+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 810626b5a36704dd5d28370460ebe3d0ea91fd83..57fff8fb6578f12342c0a6d7b6d9496ba20654b6 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" >@@ -36,7 +37,7 @@ namespace WebCore { > class Document; > class PaymentRequest; > >-class PaymentResponse final : public RefCounted<PaymentResponse> { >+class PaymentResponse final : public RefCounted<PaymentResponse>, public EventTargetWithInlineData { > public: > static Ref<PaymentResponse> create(PaymentRequest& request) > { >@@ -71,9 +72,18 @@ public: > > void complete(std::optional<PaymentComplete>&&, 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 113d22d26ff76e906a07d9dffba6bccfb256b6a4..97632fc8c07ae9403fc4e3756a6c4b5b701d864e 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; >@@ -41,4 +41,6 @@ > readonly attribute DOMString? payerPhone; > > Promise<void> complete(optional PaymentComplete result = "unknown"); >+ >+ 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..e0f90751b8f60d512096f7727b48c41bb40c35eb 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,12 @@ >+2018-09-03 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 NOBODY (OOPS!). >+ >+ * 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