-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add "get unpartitioned cookie enabled state" algo #1
Conversation
storage-access.bs
Outdated
@@ -147,6 +147,12 @@ partial interface Document { | |||
}; | |||
</pre> | |||
|
|||
Let |get unpartitioned cookie enabled state| be an algorithm that, given {{Document}} |doc| and [=cookie store=], runs the following steps: | |||
1. Let |global| be |doc|'s [=relevant global object=]. | |||
1. Let |cookie enabled state| be the result of [=queuing a global task=] on the [=cookie store=] with |global|'s [=environment/has storage access=]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't queue a task on the cookie store, only on a task source, see https://html.spec.whatwg.org/multipage/webappapis.html#task-source for some info (but yes it's complicated, the important bit here is that you need a task source to queue tasks, which is what you do when you want to manipulate renderer state after stepping into the browser process using "in parallel").
However, it's not entirely clear to me what this step does and why it's needed. I suppose this is still WIP and you would list out steps to get unpartitioned cookie state here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I am trying to translate what Chrome code is currently doing into text: https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/blink/renderer/core/dom/document.cc;l=5890-5897;drc=b8a0323a84f483b25e94b3a24d80fda16c5dd1ae.
It's currently making a sync function call to the CookieStore to get whether unpartitioned cookies are available.
Like you said in another comment, the cookie store concept is only loosely translated, and IIUC we want to make the spec queuing tasks to get info from other sources, this is the closest text I could come up with for now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL the latest draft PR, in which I did the following:
- Made the
get unpartitioned cookie enabled state
algorithm incorporate more checks from hSA, and synchronous by checkingNavigator.cookieEnabled
; I am not sure what other spec source could be linked here, because AFAIK there is nothing to hold on to regarding the cookie part. This is also the current Chrome implementation. - In hSA, added back the step that queues a task to
permissions task source
; I am not sure if this step should be removed; if we don't, then hSA is technically a sync method which reopens the issues hasStorageAccess() always queues a task to resolve with the environment's boolean? privacycg/storage-access#164 and Synchronous hasStorageAccess? privacycg/storage-access#146. - In rSA, moved up the step that calls
get unpartitioned cookie enabled state
so that it does not runin parallel
(because the algorithm is sync now).
Co-authored-by: Johann Hofmann <[email protected]>
(See WHATWG Working Mode: Changes for more details.)