Change from clients.openWindow to event.openWindow.#106
Change from clients.openWindow to event.openWindow.#106ianbjacobs merged 5 commits intow3c:gh-pagesfrom
Conversation
adrianhopebailie
left a comment
There was a problem hiding this comment.
LGTM, thanks @tommythorsen
ec2e1a5 to
9996e16
Compare
|
I have updated the PR to sit on top of @ianbjacobs' restructuring. Does it still look ok? |
index.html
Outdated
| [Exposed=ServiceWorker] | ||
| interface PaymentRequestEvent : ExtendableEvent { | ||
| readonly attribute PaymentAppRequest appRequest; | ||
| Promise<WindowClient> openWindow(DOMString url); |
There was a problem hiding this comment.
From https://heycam.github.io/webidl/#idl-USVString:
Specifications should only use USVString for APIs that perform text processing and need a string of Unicode scalar values to operate on. Most APIs that use strings should instead be using DOMString, which does not make any interpretations of the code units in the string. When in doubt, use DOMString.
I was in doubt, so I used DOMString. What calls for USVString in this situation?
index.html
Outdated
| This attribute contains the <a>payment app request</a> associated | ||
| with this <a>payment request</a>. | ||
| </dd> | ||
| <dt><code>openWindow</code> method</dt> |
There was a problem hiding this comment.
Please define methods in their own section.
There was a problem hiding this comment.
I've done this, but now this section is inconsistent with the rest of the document. I can go through and give the other sections the same treatment, but that will be a separate PR.
index.html
Outdated
| <dt><code>openWindow</code> method</dt> | ||
| <dd> | ||
| This method is used by the payment handler to show a window to | ||
| the user. |
There was a problem hiding this comment.
Should like to algorithm that describes steps
index.html
Outdated
| <p class="issue">See <a href="https://github.com/w3c/webpayments-payment-apps-api/issues/97">issue 97</a> for discussion about opening window in a way that is consistent with payment flow and not confusing to the user. For example, there is consensus that in a desktop environment, a payment handler should <em>not</em> open a window in a new browser tab, as this is too dissociated from the checkout context.</p> | ||
|
|
||
| <p>User agents SHOULD display the origin of a running payment handler to the user.</p> | ||
| <p>A payment handler that requires visual display and user interaction, may call <code>PaymentRequestEvent.openWindow()</code>. |
There was a problem hiding this comment.
nit: <code>PaymentRequestEvent.openWindow()</code>. openWindow()`.
index.html
Outdated
| Since user agents know that this method is connected to the payment request event, they SHOULD render the window in a way that is consistent with the flow and not confusing to the user.</p> | ||
|
|
||
| <p>The resulting window client is bound to the tab/window that initiated the <a>payment request</a>. | ||
| A single <a>payment handler</a> SHOULD NOT be allowed to open more than one client window using this method. |
There was a problem hiding this comment.
All this needs to be in algorithm.
There was a problem hiding this comment.
I'm working on this. Aiming to update this PR with an algorithm for openWindow tomorrow.
index.html
Outdated
|
|
||
| <p>The resulting window client is bound to the tab/window that initiated the <a>payment request</a>. | ||
| A single <a>payment handler</a> SHOULD NOT be allowed to open more than one client window using this method. | ||
| The exact behavior in the case where a payment handler calls <code>openWindow()</code> multiple times, is left to the user agent implementers to decide on. |
There was a problem hiding this comment.
It should probably throw.
There was a problem hiding this comment.
Ok. I'll change this.
index.html
Outdated
| The exact behavior in the case where a payment handler calls <code>openWindow()</code> multiple times, is left to the user agent implementers to decide on. | ||
| User agents MAY, in this case, let subsequent calls to <code>openWindow()</code> resolve to the same <code>WindowClient</code> instance.</p> | ||
|
|
||
| <p>User agents SHOULD display the origin of the payment handler to the user.</p> |
There was a problem hiding this comment.
Should be in the privacy and security considerations section
|
This is not aimed at @tommythorsen - but in general, can we please be extremely disciplined with adding things to this spec. We've had to waste a lot of time on the Payment Request spec dealing with technical debt built up by adding bad markup, random phrasing, conformance statements that don't actually apply to any products, etc. Can we also be disciplined with running HTML5 Tidy over the document before any commit goes in - and make sure ReSpec is being utilized to the fullest (i.e., don't use Also, no one should be committing directly to ReSpec is already screaming that this document has over 66 issues. That's already really alarming - we need to do better and not rush things into the spec. If Editors need a "how to best use ReSpec" tutorial during the F2F, I'm happy to run that. |
I doesn’t seem appropriate for me or anybody else from the W3C staff to try to unilaterally impose branch protection on a repo. That should be something for the people actually doing the work to discuss and decide on. https://github.com/orgs/w3c/teams/payment-app-api-editors shows a number of people with admin access to the repo who can set pull-request-required branch protection for the default branch if that’s what they want. |
|
@sideshowbarker, fair. Can someone with admin please put branch protection on? |
Done! |
7198666 to
80ada6f
Compare
@marcoscaceres - thanks for this comment. I think I speak for all of the editors (@ianbjacobs , @adamroach , @tommythorsen , @jnormore and myself) when I say that we're fairly new to this (and if not then fairly new to specs that include WebIDL and browser algorithms or new to ReSpec or GitHub or all of it). So, I am 100% in agreement that we try and avoid accumulating debt that we need to deal with later but also appeal to you to help us out here. Feel free to point out things we're doing wrong (as you have above) or share some pro tips because we're keen to do them right. While I appreciate you are putting a lot of effort into the PR spec right now your help as an editor here would be appreciated if you can spare some time. I think that at a minimum @tommythorsen , you and I could have an occasional call to sync up since timezones make it hard for you guys to join the TF calls. |
80ada6f to
45aae5b
Compare
|
I think I have addressed all of @marcoscaceres' review comments. I have introduced a few more respec warnings, but I intend to take a closer look at the whole list of respec issues in another PR, after this one is finished. |
c235833 to
4471bbb
Compare
|
Thanks for the update. Will follow up soon.
… On 16 Mar 2017, at 8:37 pm, Tommy Thorsen ***@***.***> wrote:
I think I have addressed all of @marcoscaceres' review comments. I have introduced a few more respec warnings, but I intend to take a closer look at the whole list of respec issues in another PR, after this one is finished.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
Thank you @tommythorsen! I have looked at the changes. I look forward to @marcoscaceres' review. @jakearchibald, your input would also be appreciated. Ian |
|
A general note on style and invoking algorithms: see how it's done in the Payment Request spec. Ideally, this spec should end up being edited in the same way as that one. For other examples of excellent specs whose style we should follow: |
|
The general approach of opening the window via a call on the event (to make it context-aware) LGTM. |
Good guides if getting started:
I'm happy to help. Please tag me on reviews and I'll get to them as quickly as possible. I'll have more time once we put Payment Request into CR. |
|
@marcoscaceres: Thanks for the pointers! Did you have any specific change requests? This PR is blocked from merging by your earlier change request, so if you're happy with the current state of the PR, perhaps you would like to change to approval? |
|
Odd? I added 30+ change requests earlier today?
… On 17 Mar 2017, at 8:52 pm, Tommy Thorsen ***@***.***> wrote:
@marcoscaceres: Thanks for the pointers!
Did you have any specific change requests? This PR is blocked from merging by your earlier change request, so if you're happy with the current state of the PR, perhaps you would like to change to approval?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
|
@tommythorsen see my change requests above. I can see them all there |
|
30 change requests from today? The only change requests I can see are the 7 outdated ones from two days ago. |
|
@marcoscaceres: I still see no new change requests from you. I have not received an email about them either. Can you double-check that they have been submitted? Can anyone else see these new change requests? @ianbjacobs? @adrianhopebailie? |
| <table> | ||
| <tr> | ||
| <th>Internal Slot</th> | ||
| <th>Description (<em>non-normative</em>)</th> |
There was a problem hiding this comment.
If we are going to have defaults, we should have a default column in the table.
index.html
Outdated
| <section> | ||
| <h3>Handling a payment request event</h3> | ||
| <p>Upon receiving a <a>payment request</a> by way of | ||
| <code>PaymentRequest.show()</code> and subsequent user |
There was a problem hiding this comment.
Nit: <code><a data-cite="!payment-request#show-method">PaymentRequest.show()</a></code>
index.html
Outdated
| <p>Upon receiving a <a>payment request</a> by way of | ||
| <code>PaymentRequest.show()</code> and subsequent user | ||
| selection of a payment handler, the <a>user agent</a> | ||
| MUST run the following steps or their equivalent:</p> |
There was a problem hiding this comment.
nit: remove "their equivalent"
index.html
Outdated
| MUST run the following steps or their equivalent:</p> | ||
| <ol> | ||
| <li>Let <var>registration</var> be the <a>service | ||
| worker registration</a> corresponding to the payment |
There was a problem hiding this comment.
Expected link to "payment handler" definition
index.html
Outdated
| than one client window using this method.</p> | ||
| <section> | ||
| <h3><dfn>Open Window Algorithm</dfn></h3> | ||
| <p class="note">This algorithm is <i>very</i> similar to |
There was a problem hiding this comment.
nit: class="ednote" ... should probably file a new bug for this, then we can link it to the spec.
There was a problem hiding this comment.
index.html
Outdated
| know that this method is connected to the payment request | ||
| event, they SHOULD render the window in a way that is | ||
| consistent with the flow and not confusing to the user.</p> | ||
| <p>The resulting window client is bound to the tab/window |
There was a problem hiding this comment.
Same with this... all this reads very "non-normative".
index.html
Outdated
| conveyed using the following dictionary: | ||
| <section data-dfn-for="PaymentAppRequest" data-link-for="PaymentAppRequest"> | ||
| <h3>Payment App Request</h3> | ||
| <p>The <a>payment app request</a> is |
There was a problem hiding this comment.
this is redundant. Talk about PaymentAppRequest instead.
index.html
Outdated
| associated with this <a>payment request</a>.</p> | ||
| </section> | ||
| <section> | ||
| <h3><dfn data-lt="openWindow()">openWindow</dfn> |
There was a problem hiding this comment.
nit: <dfn>openWindow()</dfn>
index.html
Outdated
| <h3><dfn data-lt="openWindow()">openWindow</dfn> | ||
| method</h3> | ||
| <p>This method is used by the payment handler to show a | ||
| window to the user. It invokes the <a>Open Window |
There was a problem hiding this comment.
Maybe say: "When called, it runs the ..." in lower case.
index.html
Outdated
| Algorithm</a>.</p> | ||
| </section> | ||
| <section> | ||
| <h3><dfn>respondWith</dfn> method</h3> |
|
Argh, my bad. Seems I didn't hit the request changes button. |
This change introduces a new method on the PaymentRequestEvent, called openWindow(). It is similar to clients.openWindow, but since it has a tighter relationship to the PaymentRequest, it should be more convenient for implementors to provide an experience that fits the payment flow.
2fbdf15 to
d33e8f5
Compare
marcoscaceres
left a comment
There was a problem hiding this comment.
So, approving this for merge so we can deal with the much larger issues around event dispatching. All that needs to be rewritten.
|
I feel like we should still pull everything out of this spec an slowly add it back in one part at a time. We've again gone rushed a whole bunch of stuff into a spec without it being carefully checked 😭. |
This change introduces a new method on the PaymentRequestEvent, called
openWindow(). It is similar to clients.openWindow, but since it has a
tighter relationship to the PaymentRequest, it should be more convenient
for implementors to provide an experience that fits the payment flow.
See #97.