-
Notifications
You must be signed in to change notification settings - Fork 46
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
guidance on inheritance between contexts #111
Comments
(Note that I've found at least one case where we have to inherit into dedicated workers (though alternatively we could treat this header as setting a policy for the agent cluster, which seems somewhat attractive in a way and would sidestep this inheritance question): |
In the current HTML spec, a dedicated worker doesn't inherit its parent's referrer policy (whatwg/html#3270) |
+1. This inconsistency makes the Blink implementation and WPT complicated. cc: @hiroshige-g |
@nhiroki did you see whatwg/html#4916? |
@annevk Sorry for the late reply. Yes, I read the issue. I heard there was a discussion about the policy inheritance at TPAC from @hiroshige-g. I'll update/close whatwg/html#3270 based on the final decision. |
We (mainly @mikewest @annevk @wanderview @hiroshige-g) had a discussion around TPAC 2019, and reached a consensus: More detailed summary is here: |
@annevk please let me know if I'm missing something or not summarizing correctly. |
Thanks for writing that up @hiroshige-g, looks good to me! |
@kenchris and I took a look at this during the TAG F2F this week. We're really happy that the TPAC discussion was so fruitful. We'll hold off on adding something to the Design Principles document until whatwg/html#4926 is resolved. Thanks! |
FYI some updates: I also investigated the of feasibility of changing CSP inheritance rule. Originally I was wondering comparing CSPs of parent Documents and worker script's response headers and seeing whether they are the same, but when I looked at some major websites, they set different policies (due to nonce, due to minor diffs, or just setting completely different CSPs). |
@hiroshige-g Do you think some recommendations can be crafted from your investigation? In which case what would they be? |
Friendly ping @hiroshige-g ! |
There are a number of places in the web platform where some policy or state is inherited from one context to another. Its up to each feature in the platform to define how it gets inherited or not. The result is that there are a number of inconsistent inheritance behaviors.
Some downsides of this inconsistent behavior are:
It might be nice to have some guidance on how inheritance should work on the web platform to produce a more consistent system.
Off the top of my head I can think of the following types of inheritance:
createObjectURL()
was called.createObjectURL()
? w3c/ServiceWorker#1261, should a frame navigated to about:blank inherit a service worker controller? w3c/ServiceWorker#1350.There are probably more cases to consider.
My personal preference would be to make all inheritable attributes align to the same source. So if a local URL inherits an origin from a context, then all other attributes are inherited from that same source context. If a context has its own URL that defines its own origin, then nothing is inherited from other contexts.
Thanks for your help sorting this out!
The text was updated successfully, but these errors were encountered: