-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should <meta name=accept-ch content>
be parsed like HTTP Permissions-Policy
or HTML allow
?
#108
Comments
I think 3 is most likely, I'll take a stab at that Friday. |
To elaborate on reasoning:
(2) We not only ignore self in the meta tag, but don't remove self as a valid target if it's in the default/http-header policy no matter how the meta tag is defined.
(3) We only read the new list of hosts for each policy, and append it to the list that already exists.
We are very deliberately providing something short of a true permissions policy and really need to document it. |
Is there any precedent for serializing: [key1: [value1, value2,...], key2: [value1, value2...]] ...into an HTML attribute? |
I suppose srcset="a.jpg 300w 200h, b.jpg 600w 400h, c.jpg 1200w 800h" So is style="font-family: system-ui, sans-serif; margin: 2em 1em;" |
@arichiv Is there any usage of the new Cloudinary, for one, is still well-situated to update our recommendations to customers, if the syntax changes. We haven't published docs or a blog post and have yet to reach out to many customers. But that door is closing. For the (hopefully many) developers who try to implement HTML hint delegation in the future, I'd rather we end up with a less confusing syntax. Here are things I find tripping people up about it:
@arichiv do you agree with any of that? Is the door to changing Chrome's implementation already closed? Again, I'm most of all excited that this functionality exists. Existing >>> it being perfect, or even all that easy to learn/teach (most of our customers will be copy/pasting from our docs). And sincere apologies for swooping in with criticism late, after having ample opportunity to review earlier, after Chrome already shipped! |
@yoavweiss wanted to get your take on the above ideas as well, it's true the place we ended up is kinda weird. |
Any progress? M104 is getting closer and Cloudinary has paused our customer outreach efforts until this is settled. |
Sorry for the delay, Yoav and I are slated to discuss next week. As long as the change is parsing only, there will not be an issue making M104. Additionally, if there is a parsing change we will support the current format for at least a milestone and add counters to detect when it's safe to remove. |
Okay @yoavweiss and I talked, we have four options:
We're leaning toward moving back the CH-Legacy-Mode change to M105 to have longer to discuss, and will be considering disabling the https://bugs.chromium.org/p/chromium/issues/detail?id=1330554 |
@eeeps would be interested in your thoughts to the options above. 🙇 |
@arichiv Thanks for working on this and @miketaylr thanks for the ping! Thanks also for the updates re: timelines! Seeing them laid out like this, option 2 seems by far the worst, because you'd have to single quote the HTML attribute or I guess use I will also feel bad if this issue results in option 4, if only because, while I get that they're currently separate mechanisms, I don't see why an author would ever delegate without enabling (see: #23), and was excited that the initial proposal here rolled the two actions into one. Between 1 and 3 I'd go with option 3, purely because it has the HTML-iest feel to it. I don't see the benefit of adopting a structured-headers-ish syntax in an HTML attribute. I hesitate to do this but perhaps I could present... option 5?:
|
5 is the same as 3 but with a different name right? The one point of confusion we foresee is that it looks like allow syntax but rather than use policy names (ch-dpr) it uses the actual hint names (sec-ch-dpr). This makes sense as we aren't just delegating hints, but requesting hints as well. However, it's still a point of difference from the allow syntax. |
@arichiv Yeah. And that's valid; I'm worried about folks mistaking it for A rough survey of a few people and a quick tour through the HTML spec indicates that while spaces are the most common way to delimit lists in HTML, commas come in a close second. Maybe we could further differentiate by changing that second-level delimiter? And @zcorpan pointed me to whatwg/html#2335, which, while unresolved, seems relevant. [noises from the bikeshed intensify]:
|
My own personal take is this is hopefully something that devs can just copy from a docs snippet (or have a tool auto-generate for them) and never think about. Wishful thinking! Adding support for @domenic's proposal in w3ctag/design-reviews#702 (comment) seems like a good path forward. And then we eventually remove support for what we just shipped. (while we're bikeshedding, another benefit of |
Just to recap, a new syntax like the following will be introduced
in M105. No changes to the M104 launch schedule will occur. |
@arichiv sounds great. Thank you! |
closes #108 https://bugs.chromium.org/p/chromium/issues/detail?id=1334152 This uses the iframe allow syntax (which we were already improperly referencing) and clarifies how the parsing should work based on chrome behavior.
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
* Update parsing algorithm closes #108 https://bugs.chromium.org/p/chromium/issues/detail?id=1334152 This uses the iframe allow syntax (which we were already improperly referencing) and clarifies how the parsing should work based on chrome behavior. * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs * Update index.bs
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
Heads up that in M105 not only will the new http-equiv="delegate-ch" syntax be added, but the older name="accept-ch" syntax will be removed. The even older http-equiv="accept-ch" that does not support delegation will not be touched as usage is too high. |
Did you mean supported? |
Very sorry yes, meant to say 'added'. The comment has been updated |
This adds support for the delegate-ch meta tag. It works like the accept-ch meta tag, except it uses the same syntax as the allow iframe attribute. WICG/client-hints-infrastructure#108 This CL is part of a series: (1) Add support to chromium (2) Add tests to devtools Commit: false Bug: 1334152 Change-Id: I19ce426da8a0aa158aad1fde24f3bd4f19581c52
Just a note on the actual implementation vs. the syntax described in this thread and and elsewhere : It's the
Hopefully this saves some time/frustration... |
allow
attribute.allow
has a different syntax than the HTTPPermissions-Policy
header, which relies on Structured Field parsing.<meta name="accept-ch">
syntax that resemblesPermissions-Policy
/Structured Fields, with at least one subtle difference: origins can't be quoted, as sf-strings are.Here's what I got to work in shipping Chrome:
Here's what I would expect, based on the spec:
(although I'm not 100% on what quotes go where, honestly. luv 2 interpret ABNF...)
I see three ways forward:
allow
parsing rules (too late?)content
attribute is parsed using thePermissions-Policy
sf-header rules, and Chrome updates its implementation to eliminate any subtle differences (e.g. sf-string quoting... perhaps others?)<meta name="accept-ch">
parsing rules that are shipping in Chrome, which match neitherallow
norPermissions-Policy
.I'd prefer 1 over 2 over 3, but if there's any usage, we may be stuck with 3.
The text was updated successfully, but these errors were encountered: