[w3c/webpayments-payment-apps-api] Different approaches to opening windows (#97)

In the current Payment App Spec, user interaction is performed via a call to `ServiceWorkerGlobalScope.clients.openWindow()`. In @marcoscaceres' [Payment Request Handler](https://marcoscaceres.github.io/payment-request-handler/) document, this is instead handled with a new `openClientWindow()` method on the `PaymentRequestEvent`.

There are pros and cons to each approach.

With `ServiceWorkerGlobalScope.clients.openWindow()`, we re-use the existing machinery and specification of Service Workers, albeit with a need to specify that the web browser make the determination that such a window is being opened in a web payment context and takes steps to render it sensible. This is not difficult, but it _is_ implicit behavior.

With `PaymentRequestEvent.openClientWindow()`, the fact that this is a different kind of window altogether is clearer, and the binding between the window and its corresponding event is also clearer. On the downside, this approach requires us to respecify [a substantial amount of existing handling](https://www.w3.org/TR/service-workers-1/#clients-openwindow) -- further, by inventing a new affordance where an existing one seems to be adequate doesn't feel like it's very much in the spirit of the extensible web. (Some may recall that my original proposal included a separate mechanism for opening this window, but I decided that re-use was better than re-invention).

So, which approach do we want to use?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments-payment-apps-api/issues/97

Received on Monday, 23 January 2017 22:30:00 UTC