[Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEvent...
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 19:57:19 +0000 (19:57 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2018 19:57:19 +0000 (19:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189100

Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https-expected.txt:
* web-platform-tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https-expected.txt:
* web-platform-tests/payment-request/onpaymentmenthodchange-attribute.https-expected.txt:

Source/WebCore:

Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
defined in the Payment Request API W3C Editor's Draft of 30 August 2018.

<https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>

The "payment method changed" algorithm will be implemented in a follow-up.

Covered by existing web platform tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
(WebCore::PaymentMethodChangeEvent::eventInterface const):
(WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
* Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
* Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
* Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
* Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
* Modules/paymentrequest/PaymentRequest.idl:
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.h:
* dom/EventNames.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235518 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/payment-request/onpaymentmenthodchange-attribute.https-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h [new file with mode: 0644]
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.h [new file with mode: 0644]
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.idl [new file with mode: 0644]
Source/WebCore/Modules/paymentrequest/PaymentRequest.idl
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.h
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEventInit.h
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/EventNames.in

index 6e1e1cb..d144d65 100644 (file)
@@ -1,3 +1,14 @@
+2018-08-30  Andy Estes  <aestes@apple.com>
+
+        [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
+        https://bugs.webkit.org/show_bug.cgi?id=189100
+
+        Reviewed by Daniel Bates.
+
+        * web-platform-tests/payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https-expected.txt:
+        * web-platform-tests/payment-request/PaymentMethodChangeEvent/methodName-attribute.https-expected.txt:
+        * web-platform-tests/payment-request/onpaymentmenthodchange-attribute.https-expected.txt:
+
 2018-08-29  Olivia Barnett  <obarnett@apple.com>
 
         Implement the Web Share API
index 71d1b49..b36a2e2 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL Must have a methodDetails IDL attribute, which is initialized with to the methodName dictionary value Can't find variable: PaymentMethodChangeEvent
+PASS Must have a methodDetails IDL attribute, which is initialized with to the methodName dictionary value 
 
index 2dd6080..544eb32 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL Must have a methodName IDL attribute, which is initialized with to the methodName dictionary value Can't find variable: PaymentMethodChangeEvent
+PASS Must have a methodName IDL attribute, which is initialized with to the methodName dictionary value 
 
index f310050..a2f874e 100644 (file)
@@ -1,6 +1,6 @@
 
-FAIL Must have a onpaymentmethodchange IDL attribute assert_idl_attribute: property "onpaymentmethodchange" not found in prototype chain
-FAIL onpaymentmethodchange attribute is a generic handler for "paymentmethodchange" assert_true: event did not fire expected true got false
-FAIL onpaymentmethodchange attribute is a handler for PaymentMethodChangeEvent Can't find variable: PaymentMethodChangeEvent
-FAIL onpaymentmethodchange attribute and listeners both work Can't find variable: PaymentMethodChangeEvent
+PASS Must have a onpaymentmethodchange IDL attribute 
+PASS onpaymentmethodchange attribute is a generic handler for "paymentmethodchange" 
+PASS onpaymentmethodchange attribute is a handler for PaymentMethodChangeEvent 
+PASS onpaymentmethodchange attribute and listeners both work 
 
index cd78931..fef9976 100644 (file)
@@ -342,6 +342,8 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/paymentrequest/PaymentDetailsModifier.idl
     Modules/paymentrequest/PaymentDetailsUpdate.idl
     Modules/paymentrequest/PaymentItem.idl
+    Modules/paymentrequest/PaymentMethodChangeEvent.idl
+    Modules/paymentrequest/PaymentMethodChangeEventInit.idl
     Modules/paymentrequest/PaymentMethodData.idl
     Modules/paymentrequest/PaymentOptions.idl
     Modules/paymentrequest/PaymentRequest.idl
index 05033cb..6195ecd 100644 (file)
@@ -1,3 +1,39 @@
+2018-08-30  Andy Estes  <aestes@apple.com>
+
+        [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
+        https://bugs.webkit.org/show_bug.cgi?id=189100
+
+        Reviewed by Daniel Bates.
+
+        Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
+        defined in the Payment Request API W3C Editor's Draft of 30 August 2018.
+
+        <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>
+
+        The "payment method changed" algorithm will be implemented in a follow-up.
+
+        Covered by existing web platform tests.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
+        (WebCore::PaymentMethodChangeEvent::eventInterface const):
+        (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
+        * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
+        * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
+        * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
+        * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
+        * Modules/paymentrequest/PaymentRequest.idl:
+        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
+        (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
+        * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
+        * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.h:
+        * dom/EventNames.in:
+
 2018-08-30  Brent Fulgham  <bfulgham@apple.com>
 
         The width of a nullptr TextRun should be zero
index a5fdb3e..f787586 100644 (file)
@@ -262,6 +262,8 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/paymentrequest/PaymentDetailsModifier.idl \
     $(WebCore)/Modules/paymentrequest/PaymentDetailsUpdate.idl \
     $(WebCore)/Modules/paymentrequest/PaymentItem.idl \
+    $(WebCore)/Modules/paymentrequest/PaymentMethodChangeEvent.idl \
+    $(WebCore)/Modules/paymentrequest/PaymentMethodChangeEventInit.idl \
     $(WebCore)/Modules/paymentrequest/PaymentMethodData.idl \
     $(WebCore)/Modules/paymentrequest/PaymentOptions.idl \
     $(WebCore)/Modules/paymentrequest/PaymentRequest.idl \
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp b/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp
new file mode 100644 (file)
index 0000000..60082b9
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PaymentMethodChangeEvent.h"
+
+#if ENABLE(PAYMENT_REQUEST)
+
+#include "PaymentMethodChangeEventInit.h"
+
+namespace WebCore {
+
+EventInterface PaymentMethodChangeEvent::eventInterface() const
+{
+    return PaymentMethodChangeEventInterfaceType;
+}
+
+PaymentMethodChangeEvent::PaymentMethodChangeEvent(const AtomicString& type, const PaymentMethodChangeEventInit& eventInit)
+    : PaymentRequestUpdateEvent { type, eventInit }
+    , m_methodName { eventInit.methodName }
+    , m_methodDetails { eventInit.methodDetails }
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(PAYMENT_REQUEST)
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h b/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h
new file mode 100644 (file)
index 0000000..42754d4
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(PAYMENT_REQUEST)
+
+#include "PaymentRequestUpdateEvent.h"
+#include <JavaScriptCore/Strong.h>
+#include <wtf/text/WTFString.h>
+
+namespace JSC {
+class JSObject;
+}
+
+namespace WebCore {
+    
+struct PaymentMethodChangeEventInit;
+
+class PaymentMethodChangeEvent final : public PaymentRequestUpdateEvent {
+public:
+    template<typename... Args> static Ref<PaymentMethodChangeEvent> create(Args&&... args)
+    {
+        return adoptRef(*new PaymentMethodChangeEvent(std::forward<Args>(args)...));
+    }
+
+    const String& methodName() const { return m_methodName; }
+    const JSC::Strong<JSC::JSObject>& methodDetails() const { return m_methodDetails; }
+
+    // Event
+    EventInterface eventInterface() const override;
+
+private:
+    PaymentMethodChangeEvent(const AtomicString& type, const PaymentMethodChangeEventInit&);
+
+    String m_methodName;
+    JSC::Strong<JSC::JSObject> m_methodDetails;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(PAYMENT_REQUEST)
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.idl b/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.idl
new file mode 100644 (file)
index 0000000..da307f7
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=PAYMENT_REQUEST,
+    Constructor(DOMString type, optional PaymentMethodChangeEventInit eventInitDict),
+    EnabledBySetting=PaymentRequest,
+    Exposed=Window,
+    SecureContext,
+] interface PaymentMethodChangeEvent : PaymentRequestUpdateEvent {
+    readonly attribute DOMString methodName;
+    readonly attribute object? methodDetails;
+};
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.h b/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.h
new file mode 100644 (file)
index 0000000..d3ffd9c
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(PAYMENT_REQUEST)
+
+#include "PaymentRequestUpdateEventInit.h"
+#include <JavaScriptCore/Strong.h>
+
+namespace JSC {
+class JSObject;
+}
+
+namespace WebCore {
+
+struct PaymentMethodChangeEventInit final : PaymentRequestUpdateEventInit {
+    String methodName;
+    JSC::Strong<JSC::JSObject> methodDetails;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(PAYMENT_REQUEST)
diff --git a/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.idl b/Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.idl
new file mode 100644 (file)
index 0000000..11c8d54
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=PAYMENT_REQUEST,
+] dictionary PaymentMethodChangeEventInit : PaymentRequestUpdateEventInit {
+    DOMString methodName = "";
+    object? methodDetails;
+};
index b8b3184..f992267 100644 (file)
@@ -43,5 +43,6 @@
 
     attribute EventHandler onshippingaddresschange;
     attribute EventHandler onshippingoptionchange;
+    attribute EventHandler onpaymentmethodchange;
     attribute EventHandler onmerchantvalidation;
 };
index c205335..13ad163 100644 (file)
@@ -32,8 +32,8 @@
 
 namespace WebCore {
 
-PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, PaymentRequestUpdateEventInit&& eventInit)
-    : Event { type, WTFMove(eventInit), IsTrusted::No }
+PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, const PaymentRequestUpdateEventInit& eventInit)
+    : Event { type, eventInit, IsTrusted::No }
 {
 }
 
index 30041a2..04e1372 100644 (file)
@@ -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
@@ -47,13 +47,12 @@ public:
 
 protected:
     PaymentRequestUpdateEvent(const AtomicString& type, PaymentRequest&);
+    PaymentRequestUpdateEvent(const AtomicString& type, const PaymentRequestUpdateEventInit&);
 
     // Event
     EventInterface eventInterface() const override;
 
 private:
-    PaymentRequestUpdateEvent(const AtomicString& type, PaymentRequestUpdateEventInit&&);
-
     RefPtr<PaymentRequest> m_paymentRequest;
     bool m_waitForUpdate { false };
 };
index 6b736d3..ce911fe 100644 (file)
@@ -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
@@ -31,7 +31,7 @@
 
 namespace WebCore {
 
-struct PaymentRequestUpdateEventInit final : public EventInit {
+struct PaymentRequestUpdateEventInit : EventInit {
 };
 
 } // namespace WebCore
index 3469fcd..5915736 100644 (file)
@@ -189,6 +189,7 @@ Modules/notifications/NotificationController.cpp
 Modules/paymentrequest/MerchantValidationEvent.cpp
 Modules/paymentrequest/PaymentAddress.cpp
 Modules/paymentrequest/PaymentHandler.cpp
+Modules/paymentrequest/PaymentMethodChangeEvent.cpp
 Modules/paymentrequest/PaymentRequest.cpp
 Modules/paymentrequest/PaymentRequestUpdateEvent.cpp
 Modules/paymentrequest/PaymentResponse.cpp
@@ -2816,6 +2817,8 @@ JSPaymentDetailsInit.cpp
 JSPaymentDetailsModifier.cpp
 JSPaymentDetailsUpdate.cpp
 JSPaymentItem.cpp
+JSPaymentMethodChangeEvent.cpp
+JSPaymentMethodChangeEventInit.cpp
 JSPaymentMethodData.cpp
 JSPaymentOptions.cpp
 JSPaymentRequest.cpp
index f361874..24842ab 100644 (file)
                A15D751B1E68F8A300A35FBC /* JSBlobCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = A15D75181E68F83600A35FBC /* JSBlobCallback.h */; };
                A15E31F41E0CB0B5004B371C /* QuickLook.h in Headers */ = {isa = PBXBuildFile; fileRef = A15E31F11E0CB0AA004B371C /* QuickLook.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A15E6BF11E212A6A0080AF34 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A15E6BF01E212A6A0080AF34 /* Foundation.framework */; };
+               A164A2472134BC7100509156 /* PaymentMethodChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A2442134BC7100509156 /* PaymentMethodChangeEvent.h */; };
+               A164A24E2134BDD800509156 /* PaymentMethodChangeEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A24B2134BDD800509156 /* PaymentMethodChangeEventInit.h */; };
+               A164A2552134C1CC00509156 /* JSPaymentMethodChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A2512134C1CB00509156 /* JSPaymentMethodChangeEvent.h */; };
+               A164A2562134C1CC00509156 /* JSPaymentMethodChangeEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A164A2522134C1CB00509156 /* JSPaymentMethodChangeEventInit.h */; };
                A1763F3F1E205234001D58DE /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = A1763F3D1E205234001D58DE /* WebArchiveDumpSupport.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1763F411E20586E001D58DE /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1763F401E20586E001D58DE /* CFNetwork.framework */; };
                A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
                CDE595951BF16DF300A1CBE8 /* CDMSessionAVContentKeySession.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDE595931BF166AD00A1CBE8 /* CDMSessionAVContentKeySession.mm */; };
                CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE595961BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h */; };
                CDE5959D1BF2757100A1CBE8 /* CDMSessionMediaSourceAVFObjC.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDE5959C1BF2757100A1CBE8 /* CDMSessionMediaSourceAVFObjC.mm */; };
-               CDE667A41E4BBF1500E8154A /* WebAudioBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE667A21E4BBF1500E8154A /* WebAudioBufferList.cpp */; };
-               CDE667A51E4BBF1500E8154A /* WebAudioBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE667A31E4BBF1500E8154A /* WebAudioBufferList.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               CDE667A41E4BBF1500E8154A /* cocoa/WebAudioBufferList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE667A21E4BBF1500E8154A /* cocoa/WebAudioBufferList.cpp */; };
+               CDE667A51E4BBF1500E8154A /* cocoa/WebAudioBufferList.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE667A31E4BBF1500E8154A /* cocoa/WebAudioBufferList.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CDE7FC45181904B1002BBB77 /* OrderIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE7FC43181904B1002BBB77 /* OrderIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CDE83DB2183C44060031EAA3 /* VideoPlaybackQuality.h in Headers */ = {isa = PBXBuildFile; fileRef = CDE83DB0183C44060031EAA3 /* VideoPlaybackQuality.h */; };
                CDE8B5EC1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDE8B5EA1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp */; };
                339B5B62131DAA3200F48D02 /* CookiesStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookiesStrategy.h; sourceTree = "<group>"; };
                3662F984047CEDBE5DDDAFAA /* RenderMathMLMenclose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLMenclose.cpp; sourceTree = "<group>"; };
                37119A7920CCB610002C6DC9 /* WebKitTargetConditionals.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebKitTargetConditionals.xcconfig; sourceTree = "<group>"; };
-               3717D7E517ECC3A6003C276D /* extract-localizable-strings.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = extract-localizable-strings.pl; path = "Scripts/extract-localizable-strings.pl"; sourceTree = "<group>"; };
+               3717D7E517ECC3A6003C276D /* extract-localizable-strings.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = "extract-localizable-strings.pl"; path = "Scripts/extract-localizable-strings.pl"; sourceTree = "<group>"; };
                371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HyphenationCF.cpp; sourceTree = "<group>"; };
                371E65CB13661EDC00BEEDB0 /* PageSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageSerializer.h; sourceTree = "<group>"; };
                371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageSerializer.cpp; sourceTree = "<group>"; };
                A15E31F11E0CB0AA004B371C /* QuickLook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLook.h; sourceTree = "<group>"; };
                A15E31F21E0CB0AA004B371C /* QuickLook.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickLook.mm; sourceTree = "<group>"; };
                A15E6BF01E212A6A0080AF34 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+               A164A2442134BC7100509156 /* PaymentMethodChangeEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentMethodChangeEvent.h; sourceTree = "<group>"; };
+               A164A2452134BC7100509156 /* PaymentMethodChangeEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentMethodChangeEvent.cpp; sourceTree = "<group>"; };
+               A164A2462134BC7100509156 /* PaymentMethodChangeEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentMethodChangeEvent.idl; sourceTree = "<group>"; };
+               A164A24B2134BDD800509156 /* PaymentMethodChangeEventInit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentMethodChangeEventInit.h; sourceTree = "<group>"; };
+               A164A24D2134BDD800509156 /* PaymentMethodChangeEventInit.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentMethodChangeEventInit.idl; sourceTree = "<group>"; };
+               A164A2512134C1CB00509156 /* JSPaymentMethodChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentMethodChangeEvent.h; sourceTree = "<group>"; };
+               A164A2522134C1CB00509156 /* JSPaymentMethodChangeEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentMethodChangeEventInit.h; sourceTree = "<group>"; };
+               A164A2532134C1CB00509156 /* JSPaymentMethodChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentMethodChangeEvent.cpp; sourceTree = "<group>"; };
+               A164A2542134C1CC00509156 /* JSPaymentMethodChangeEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentMethodChangeEventInit.cpp; sourceTree = "<group>"; };
                A1763F3C1E205234001D58DE /* WebArchiveDumpSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebArchiveDumpSupport.mm; sourceTree = "<group>"; };
                A1763F3D1E205234001D58DE /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebArchiveDumpSupport.h; sourceTree = "<group>"; };
                A1763F401E20586E001D58DE /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
                CDE5959C1BF2757100A1CBE8 /* CDMSessionMediaSourceAVFObjC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CDMSessionMediaSourceAVFObjC.mm; sourceTree = "<group>"; };
                CDE6560E17CA6E7600526BA7 /* mediaControlsApple.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = mediaControlsApple.js; sourceTree = "<group>"; };
                CDE667A11E4BBA4D00E8154A /* PlatformAudioData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformAudioData.h; sourceTree = "<group>"; };
-               CDE667A21E4BBF1500E8154A /* WebAudioBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocoa/WebAudioBufferList.cpp; sourceTree = "<group>"; };
-               CDE667A31E4BBF1500E8154A /* WebAudioBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa/WebAudioBufferList.h; sourceTree = "<group>"; };
+               CDE667A21E4BBF1500E8154A /* cocoa/WebAudioBufferList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = cocoa/WebAudioBufferList.cpp; sourceTree = "<group>"; };
+               CDE667A31E4BBF1500E8154A /* cocoa/WebAudioBufferList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoa/WebAudioBufferList.h; sourceTree = "<group>"; };
                CDE7FC42181904B1002BBB77 /* OrderIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OrderIterator.cpp; sourceTree = "<group>"; };
                CDE7FC43181904B1002BBB77 /* OrderIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrderIterator.h; sourceTree = "<group>"; };
                CDE83DAF183C44060031EAA3 /* VideoPlaybackQuality.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VideoPlaybackQuality.cpp; sourceTree = "<group>"; };
                                A1F600541F4765040077E83F /* JSPaymentDetailsUpdate.h */,
                                A1CC56621F46146500A4555B /* JSPaymentItem.cpp */,
                                A1CC564F1F46145200A4555B /* JSPaymentItem.h */,
+                               A164A2532134C1CB00509156 /* JSPaymentMethodChangeEvent.cpp */,
+                               A164A2512134C1CB00509156 /* JSPaymentMethodChangeEvent.h */,
+                               A164A2542134C1CC00509156 /* JSPaymentMethodChangeEventInit.cpp */,
+                               A164A2522134C1CB00509156 /* JSPaymentMethodChangeEventInit.h */,
                                A1CC564D1F46145100A4555B /* JSPaymentMethodData.cpp */,
                                A1CC564C1F46145000A4555B /* JSPaymentMethodData.h */,
                                A1CC56531F46145600A4555B /* JSPaymentOptions.cpp */,
                                A1DF5AA41F7F64BB0058A477 /* PaymentHandler.h */,
                                A1F76B2E1F44C55A0014C318 /* PaymentItem.h */,
                                A1F76B301F44C55A0014C318 /* PaymentItem.idl */,
+                               A164A2452134BC7100509156 /* PaymentMethodChangeEvent.cpp */,
+                               A164A2442134BC7100509156 /* PaymentMethodChangeEvent.h */,
+                               A164A2462134BC7100509156 /* PaymentMethodChangeEvent.idl */,
+                               A164A24B2134BDD800509156 /* PaymentMethodChangeEventInit.h */,
+                               A164A24D2134BDD800509156 /* PaymentMethodChangeEventInit.idl */,
                                A1F76B161F44C3900014C318 /* PaymentMethodData.h */,
                                A1F76B181F44C3900014C318 /* PaymentMethodData.idl */,
                                A1F76B281F44C4EF0014C318 /* PaymentOptions.h */,
                CD669D651D232DF4004D1866 /* cocoa */ = {
                        isa = PBXGroup;
                        children = (
+                               CDE667A21E4BBF1500E8154A /* cocoa/WebAudioBufferList.cpp */,
+                               CDE667A31E4BBF1500E8154A /* cocoa/WebAudioBufferList.h */,
                                CD669D661D232DFF004D1866 /* MediaSessionManagerCocoa.cpp */,
                                CD227E362113AEFA00D285AF /* MediaSessionManagerCocoa.h */,
-                               CDE667A21E4BBF1500E8154A /* WebAudioBufferList.cpp */,
-                               CDE667A31E4BBF1500E8154A /* WebAudioBufferList.h */,
                        );
                        name = cocoa;
                        sourceTree = "<group>";
                                FB92DF4B15FED08700994433 /* ClipPathOperation.h in Headers */,
                                580371621A66F00A00BAF519 /* ClipRect.h in Headers */,
                                97AABD1314FA09D5007457AE /* CloseEvent.h in Headers */,
+                               CDE667A51E4BBF1500E8154A /* cocoa/WebAudioBufferList.h in Headers */,
                                C0C054CB1118C8E400CE2636 /* CodeGenerator.pm in Headers */,
                                BC5EB5DF0E81B9AB00B25965 /* CollapsedBorderValue.h in Headers */,
                                E425A49A18292B840020CFCF /* CollectionIndexCache.h in Headers */,
                                A1CC56711F46149300A4555B /* JSPaymentDetailsModifier.h in Headers */,
                                A1F6005A1F4765050077E83F /* JSPaymentDetailsUpdate.h in Headers */,
                                A1CC56731F46149800A4555B /* JSPaymentItem.h in Headers */,
+                               A164A2552134C1CC00509156 /* JSPaymentMethodChangeEvent.h in Headers */,
+                               A164A2562134C1CC00509156 /* JSPaymentMethodChangeEventInit.h in Headers */,
                                A1CC56751F46149D00A4555B /* JSPaymentMethodData.h in Headers */,
                                A1CC56771F4614A200A4555B /* JSPaymentOptions.h in Headers */,
                                A1CC56791F4614A700A4555B /* JSPaymentRequest.h in Headers */,
                                A1F76B311F44C55A0014C318 /* PaymentItem.h in Headers */,
                                1AE96A891D1A0CEB00B86768 /* PaymentMerchantSession.h in Headers */,
                                1A8A643C1D19FC5300D0E00F /* PaymentMethod.h in Headers */,
+                               A164A2472134BC7100509156 /* PaymentMethodChangeEvent.h in Headers */,
+                               A164A24E2134BDD800509156 /* PaymentMethodChangeEventInit.h in Headers */,
                                A1F76B191F44C3900014C318 /* PaymentMethodData.h in Headers */,
                                A1F76B2B1F44C4EF0014C318 /* PaymentOptions.h in Headers */,
                                A1F76B131F44C2450014C318 /* PaymentRequest.h in Headers */,
                                7132445120109DA500AE7FB2 /* WebAnimationUtilities.h in Headers */,
                                E18536841F4E481400FE091B /* WebArchiveResourceFromNSAttributedString.h in Headers */,
                                E18C35441F71970C00FF632D /* WebArchiveResourceWebResourceHandler.h in Headers */,
-                               CDE667A51E4BBF1500E8154A /* WebAudioBufferList.h in Headers */,
                                41B2A6261EF1BF6D002B9D7A /* WebAudioSourceProvider.h in Headers */,
                                07D637401BB0B11300256CE9 /* WebAudioSourceProviderAVFObjC.h in Headers */,
                                1F36EA9C1E21BA1700621E25 /* WebBackgroundTaskController.h in Headers */,
                                CDDE02ED18B3ED6D00CF7FF1 /* CDMSessionAVFoundationObjC.mm in Sources */,
                                CDDE02F018B5651300CF7FF1 /* CDMSessionAVStreamSession.mm in Sources */,
                                CDE5959D1BF2757100A1CBE8 /* CDMSessionMediaSourceAVFObjC.mm in Sources */,
+                               CDE667A41E4BBF1500E8154A /* cocoa/WebAudioBufferList.cpp in Sources */,
                                A14090FB1AA51E1D0091191A /* ContentFilterUnblockHandlerCocoa.mm in Sources */,
                                07AFF4231EFB144900B545B3 /* CoreAudioCaptureSourceIOS.mm in Sources */,
                                46C696CC1E7205FC00597937 /* CPUMonitor.cpp in Sources */,
                                A14832B9187F63D500DA63A6 /* WAKView.mm in Sources */,
                                DE5F861E1FA281FD006DB63A /* WebAccessibilityObjectWrapperBase.mm in Sources */,
                                DE5F861D1FA2815B006DB63A /* WebAccessibilityObjectWrapperMac.mm in Sources */,
-                               CDE667A41E4BBF1500E8154A /* WebAudioBufferList.cpp in Sources */,
                                CD7E05221651C28200C1201F /* WebCoreAVFResourceLoader.mm in Sources */,
                                CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */,
                                93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
index 528ca23..ec5bee6 100644 (file)
@@ -107,6 +107,7 @@ namespace WebCore {
     macro(OffscreenCanvas) \
     macro(OffscreenCanvasRenderingContext2D) \
     macro(PaymentAddress) \
+    macro(PaymentMethodChangeEvent) \
     macro(PaymentRequest) \
     macro(PaymentRequestUpdateEvent) \
     macro(PaymentResponse) \
index 275b1ca..f70dc74 100644 (file)
@@ -190,6 +190,7 @@ namespace WebCore {
     macro(paste) \
     macro(pause) \
     macro(paymentauthorized) \
+    macro(paymentmethodchange) \
     macro(paymentmethodselected) \
     macro(play) \
     macro(playing) \
index 7157c91..81e79cf 100644 (file)
@@ -50,6 +50,7 @@ AudioProcessingEvent conditional=WEB_AUDIO
 OfflineAudioCompletionEvent conditional=WEB_AUDIO
 MediaStreamTrackEvent conditional=MEDIA_STREAM
 MerchantValidationEvent conditional=PAYMENT_REQUEST
+PaymentMethodChangeEvent conditional=PAYMENT_REQUEST
 PaymentRequestUpdateEvent conditional=PAYMENT_REQUEST
 RTCPeerConnectionIceEvent conditional=WEB_RTC
 RTCDataChannelEvent conditional=WEB_RTC