whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8k stars 2.62k forks source link

"Allowed to use" should allow same-origin without the attribute #2184

Closed zcorpan closed 7 years ago

zcorpan commented 7 years ago

This is to match Feature Policy and because same-origin can just set the attribute anyway.

See https://github.com/w3c/browser-payment-api/pull/383#issuecomment-267338591

foolip commented 7 years ago

@clelland FYI

foolip commented 7 years ago

This was also discussed in https://github.com/w3c/mediacapture-main/issues/268#issuecomment-231045430.

I would like to see a path for defining the allow* attributes entirely in terms of Feature Policy, but https://github.com/whatwg/html/issues/1481 and https://bugzilla.mozilla.org/show_bug.cgi?id=1283526 make this hard.

For the other attributes, though, I wonder if it can be done, to get the alignment for free?

domenic commented 7 years ago

I think part of the issue is that feature policy is not really well-defined yet, especially for the kind of edge cases we're considering here, so we're pioneering the definitions in the allow* attributes and then feature policy will likely adopt our work.

But it does sound like fullscreen has some web-compat issues that make this tricky. Maybe what we'll want is some kind of "legacy web-compat semantics flag" to allow fullscreen to do something slightly different.

clelland commented 7 years ago

@domenic, what do you think needs to be defined better in feature policy? I'm planning on moving the algorithms and updated descriptions back from our 'specsplainer' into the actual spec for next week, and if you think there are specific edge cases that still need addressing, then I'll ensure that they are.

But it does sound like fullscreen has some web-compat issues that make this tricky. Maybe what we'll want is some kind of "legacy web-compat semantics flag" to allow fullscreen to do something slightly different.

Agreed that fullscreen may need special handling for compatibility issues, but I'd really like to avoid having to do that for other attributes if possible.

domenic commented 7 years ago

@clelland well, I hadn't looked at it in a while, so maybe it is better now. But there not being a spec definitely implied to me it was not well-defined.

It seems like the interesting edge cases identified so far are around:

But browsing the threads it looks like you are pretty aware of all this and on top of it, and @bzbarsky and @zcorpan are helping, so I think things are in good hands. I'll leave you all too it :)

bzbarsky commented 7 years ago

but #1481 and https://bugzilla.mozilla.org/show_bug.cgi?id=1283526 make this hard.

Hrm. I thought I had a reason for my general unease around fullscreen! That said, I just looked at the imdb page and I don't see them obviously using allowfullscreen on any iframes now. So it's possible they redesigned their page. Given that, maybe it's worth trying to switch everyone to the snapshotting behavior again; it really is much saner. @upsuper am I missing something on the imdb page?

upsuper commented 7 years ago

It seems to me IMDb has updated their page and it no longer uses iframe to show the video, so switching the behavior would no longer regress that page. But the question is whether that is the only page broken by this switch, which I have no idea.

If we decide to switch the behavior, I hope all browsers can coordinate to switch at roughly the same time, so that if any website is regressed, we can ask them to fix their website, rather than changing our behavior back and forth.

Given we have switched the behavior in the past, I suppose it is easy for us to do (just need to rebase some patches). So I'd like to hear whether other vendors are willing to coordinate on this.

zcorpan commented 7 years ago

Snapshot PR is https://github.com/whatwg/html/pull/2187 - let's continue discussion there. This issue is about allowing same-origin without an attribute. :-)

domenic commented 7 years ago

Getting this back on topic, what are our thoughts on making all these allow* things automatically allowed when same-origin?

Does sandboxing affect things? E.g. what if the iframe is an <iframe sandbox> without allow-same-origin? Can the contents of the iframe still reach up and toggle the attribute?

bzbarsky commented 7 years ago

Can the contents of the iframe still reach up and toggle the attribute?

No, and neither is that case same-origin. So it would work just like