KEMBAR78
Integrate with Feature Policy by marcoscaceres · Pull Request #822 · w3c/payment-request · GitHub
Skip to content

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Jan 15, 2019

closes #600
closes #698

The following tasks have been completed:

  • Confirmed there are no ReSpec errors/warnings.

Implementation commitment:

  • Safari (link to issue)
  • Chrome (link to issue)
  • Firefox (link to issue)
  • Edge (public signal)

Optional, impact on Payment Handler spec?
None.


Preview | Diff

@marcoscaceres
Copy link
Member Author

@ianbjacobs, can you give this a once over for me? Then I'll ping clelland to make sure it's technically accurate.

@marcoscaceres
Copy link
Member Author

Just noting some discussion happening here too:
web-platform-tests/wpt#14855

@marcoscaceres
Copy link
Member Author

Annevk tells me that allowpaymentrequest has been moved out of the HTML spec into feature policy spec.

I'll need to update the spec to remove reference to HTML for allowpaymentrequest.

</p>
<ol data-link-for="PaymentDetailsBase" class="algorithm">
<li data-tests=
"allowpaymentrequest/active-document-cross-origin.https.sub.html, allowpaymentrequest/active-document-same-origin.https.html, allowpaymentrequest/removing-allowpaymentrequest.https.sub.html, allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html, allowpaymentrequest/setting-allowpaymentrequest.https.sub.html">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests will be moving to Feature Policy directory as part of web-platform-tests/wpt#14855

@marcoscaceres
Copy link
Member Author

@clelland, whenever you can, would really appreciate if you could take a look at this PR.

If you have input on web-platform-tests/wpt#14855, that would also be great.

Copy link
Collaborator

@ianbjacobs ianbjacobs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Marcos,

I suggested one small change otherwise seems ok to me editorially.

@marcoscaceres
Copy link
Member Author

Appreciate the review @ianbjacobs!

@marcoscaceres marcoscaceres requested a review from domenic January 15, 2019 14:30
@domenic
Copy link
Collaborator

domenic commented Jan 15, 2019

Is there any chance that we can kill allowpaymentrequest only use allow="paymentrequest" instead? Or is there too much deployed content?

index.html Outdated
specified on the <a>iframe</a> element.
<p>
The <a data-cite="feature-policy">Feature Policy</a> specification
defines the "<code>payment</code>" feature and the <code><dfn data-cit=

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec should probably define the actual feature -- similarly to https://html.spec.whatwg.org/#policy-controlled-features or https://fullscreen.spec.whatwg.org/#feature-policy-integration, it's just a matter of declaring the feature name and the default allowlist ('self' in this case)

And, as @annevk mentioned, the allowpaymentrequest attribute is defined in HTML.

The note in the fullscreen spec is actually a pretty good fit for the situation here. allowfullscreen affects the container policy, unless overridden by allow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'm kinda conflicted between us trying to get this to REC (important to a lot of members of the WG - aiming for April) and "doing the right thing" and just normatively defining "payment" here 🤔 Our plan is to publish a REC, but then quickly spin up a "v1.1" that would formally define the feature string.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot get to REC without two implementations right? And implementations wouldn't be able to implement this any other way. Or would you leave this whole thing undefined or some such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot get to REC without two implementations right?

Correct.

And implementations wouldn't be able to implement this any other way. Or would you leave this whole thing undefined or some such?

The Feature Policy would be undefined, but there is sufficient prose in the spec (in the constructor) that an implementation that does implement either the allowpaymentrequest attribute or the Feature Policy spec would behave in conforming manner (and could be demonstratively shown to behave in a conforming manner).

@marcoscaceres
Copy link
Member Author

@domenic wrote:

Is there any chance that we can kill allowpaymentrequest only use allow="paymentrequest" instead? > Or is there too much deployed content?

@rsolomakhin, worth setting up a telemetry probe? It has shipped for about 2 years in Chrome, so might be too late... but never know.

Copy link
Collaborator

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, I don't think this is good in its current state, and I think PaymentRequest needs to define the feature. Feature Policy does not define individual features; the specs do.

@marcoscaceres
Copy link
Member Author

To be clear, I don't think this is good in its current state, and I think PaymentRequest needs to define the feature. Feature Policy does not define individual features; the specs do.

I agree with this, and it's absolutely the right thing to do - and we might need to accept it as a critical piece of the design (particularly from a security stand point... even if it delays going to REC for a bit).

Have you - or @clelland - heard anything from the WebKit folks about supporting Feature Policy? We've unfortunately not been able to get in touch with @aestes about WebKit's implementation plans.

@marcoscaceres marcoscaceres changed the title Editorial: relationship to Feature Policy spec Integrate with Feature Policy Jan 25, 2019
@marcoscaceres
Copy link
Member Author

@domenic @clelland ok, done :) I based the text on what was stated in the Fullscreen spec.

Please double check I didn't miss anything.

Copy link

@clelland clelland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, @marcoscaceres -- one question about the internal cross-reference, but the text is exactly what I'd expect.

index.html Outdated
<a>allowed to use</a> the feature indicated by attribute name
<a>allowpaymentrequest</a>, then <a>throw</a> a
"<a>SecurityError</a>" <a>DOMException</a>.
<a>allowed to use</a> the "<a>payment</a>" feature, then <a>throw</a>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be <a lt="payment-feature">payment</a>, to link to the definition in #feature-policy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clelland that would be good. However, I did it this way because Feature Policy itself doesn't actually define the "payment" feature - thus I couldn't actually link to it. However, I'm happy update the link it once Feature Policy defines it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to link to the feature-policy section in this spec, where 'payment-feature' is actually defined, not to link to the feature policy spec. Features should ideally be defined in the spec where they are used, rather than centrally in the FP spec.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry for misunderstanding. Will fix.

domenic and others added 2 commits January 29, 2019 11:31
Co-Authored-By: marcoscaceres <marcos@marcosc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable Payment Request API in CSP/iframe sandbox Integration with Feature Policy

5 participants