Bug 189100

Summary: [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, andersca, cdumez, commit-queue, dbates, esprehn+autocc, ews-watchlist, kangil.han, kondapallykalyan, sam, thorton, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=189136
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Andy Estes 2018-08-29 15:15:41 PDT
[Payment Request] Begin implementing PaymentMethodChangeEvent
Comment 1 Andy Estes 2018-08-29 15:26:28 PDT Comment hidden (obsolete)
Comment 2 Andy Estes 2018-08-29 15:29:45 PDT Comment hidden (obsolete)
Comment 3 EWS Watchlist 2018-08-29 15:33:22 PDT Comment hidden (obsolete)
Comment 4 Andy Estes 2018-08-29 16:02:19 PDT
Comment on attachment 348439 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=348439&action=review

> LayoutTests/imported/w3c/ChangeLog:11
> +        One test in onpaymentmenthodchange-attribute.https.html continues to fail due to a bug in
> +        the test.

Oops! This is a bug in the patch, not the test. Fixing.
Comment 5 Andy Estes 2018-08-29 19:12:02 PDT Comment hidden (obsolete)
Comment 6 EWS Watchlist 2018-08-29 19:14:46 PDT Comment hidden (obsolete)
Comment 7 Andy Estes 2018-08-29 20:56:15 PDT Comment hidden (obsolete)
Comment 8 EWS Watchlist 2018-08-29 21:00:56 PDT Comment hidden (obsolete)
Comment 9 Andy Estes 2018-08-30 11:34:18 PDT Comment hidden (obsolete)
Comment 10 EWS Watchlist 2018-08-30 11:36:09 PDT Comment hidden (obsolete)
Comment 11 Daniel Bates 2018-08-30 11:56:04 PDT
Comment on attachment 348520 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=348520&action=review

r=me

> Source/WebCore/ChangeLog:9
> +        by <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>.

For historical preservation, please include the date of the draft you referenced.

> Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp:27
> +#include "PaymentMethodChangeEvent.h"

I suggest we move this under the ENABLE(PAYMENT_REQUEST)-guard.

> Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp:40
> +PaymentMethodChangeEvent::PaymentMethodChangeEvent(const AtomicString& type, const PaymentMethodChangeEventInit& eventInit)

Can we make the first parameter an rvalue reference and move it into PaymentRequestUpdateEvent?

> Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h:40
> +struct PaymentMethodChangeEventInit;

This forward declaration is unnecessary as PaymentRequestUpdateEvent.h already contains it.

> Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h:44
> +    template <typename... Args> static Ref<PaymentMethodChangeEvent> create(Args&&... args)

Nit: We do not put a space between "template" and the template parameters. The code base has a mix of both kinds. The clear majority is without the space.

> Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.h:39
> +struct PaymentMethodChangeEventInit final : public PaymentRequestUpdateEventInit {

The keyword "public" is not necessary.

> Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEventInit.h:34
> +struct PaymentRequestUpdateEventInit : public EventInit {

Ditto.
Comment 12 Andy Estes 2018-08-30 12:17:35 PDT
(In reply to Daniel Bates from comment #11)
> Comment on attachment 348520 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=348520&action=review
> 
> r=me
> 
> > Source/WebCore/ChangeLog:9
> > +        by <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>.
> 
> For historical preservation, please include the date of the draft you
> referenced.

Ok.

> 
> > Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp:27
> > +#include "PaymentMethodChangeEvent.h"
> 
> I suggest we move this under the ENABLE(PAYMENT_REQUEST)-guard.

Ok.

> 
> > Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp:40
> > +PaymentMethodChangeEvent::PaymentMethodChangeEvent(const AtomicString& type, const PaymentMethodChangeEventInit& eventInit)
> 
> Can we make the first parameter an rvalue reference and move it into
> PaymentRequestUpdateEvent?

I don't think so, because then I'd initialize m_methodName and m_methodDetails using a moved-from value.

> 
> > Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h:40
> > +struct PaymentMethodChangeEventInit;
> 
> This forward declaration is unnecessary as PaymentRequestUpdateEvent.h
> already contains it.

PaymentRequestUpdateEvent.h contains a forward declaration of PaymentRequestUpdateEventInit, not PaymentMethodChangeEventInit.

> 
> > Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h:44
> > +    template <typename... Args> static Ref<PaymentMethodChangeEvent> create(Args&&... args)
> 
> Nit: We do not put a space between "template" and the template parameters.
> The code base has a mix of both kinds. The clear majority is without the
> space.
> 
> > Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEventInit.h:39
> > +struct PaymentMethodChangeEventInit final : public PaymentRequestUpdateEventInit {
> 
> The keyword "public" is not necessary.
> 
> > Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEventInit.h:34
> > +struct PaymentRequestUpdateEventInit : public EventInit {
> 
> Ditto.

Fixed.
Comment 13 Andy Estes 2018-08-30 12:22:15 PDT
Created attachment 348527 [details]
Patch
Comment 14 EWS Watchlist 2018-08-30 12:23:31 PDT
Attachment 348527 [details] did not pass style-queue:


ERROR: Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp:42:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
Total errors found: 1 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 WebKit Commit Bot 2018-08-30 12:57:27 PDT
Comment on attachment 348527 [details]
Patch

Clearing flags on attachment: 348527

Committed r235518: <https://trac.webkit.org/changeset/235518>
Comment 16 WebKit Commit Bot 2018-08-30 12:57:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Radar WebKit Bug Importer 2018-08-31 08:56:40 PDT
<rdar://problem/43941938>