-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix requestStorageAccess
to set bool to true before resolving
#166
Conversation
requestStorageAccess
to always set bool to true before resolvingrequestStorageAccess
to set bool to true before resolving
@@ -173,7 +173,7 @@ When invoked on {{Document}} |doc|, the <dfn export method for=Document><code>re | |||
1. If |doc| is not [=allowed to use=] "`storage-access`", [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. | |||
1. If |doc|'s [=Document/origin=] is an [=opaque origin=], [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. | |||
1. If the [=top-level origin=] of |doc|'s [=relevant settings object=] is an [=opaque origin=], [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. | |||
1. If |doc|'s [=Document/origin=] is [=same origin=] with the [=top-level origin=] of |doc|'s [=relevant settings object=], [=/resolve=] and return |p|. | |||
1. If |doc|'s [=Document/origin=] is [=same origin=] with the [=top-level origin=] of |doc|'s [=relevant settings object=], set |global|'s [=environment/has storage access=] to true, then [=/resolve=] and return |p|. |
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.
I guess this is motivated by ABA-type of embedding? If it is it seems like the algorithm for hasStorageAccess()
would need changes as well. And we'd probably need some more involved explanation here. I discussed some possible solutions to this with @johannhof at some point.
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.
That is what this particular step is about - but I'd say that's out of scope for this pull request. My goal for this PR is to ensure that in every case that document.requestStorageAccess()
currently resolves, a subsequent invocation of document.hasStorageAccess()
would resolve and yield true
.
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.
I think in that case this step doesn't need to be changed because requestStorageAccess()
already resolves with true for this particular condition.
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.
Though now that I look at hasStorageAccess
again, I see that it also has a step for this case, so this PR seems unnecessary. Will revert.
This PR fixes the
requestStorageAccess
algorithm so thatglobal
'shas storage access
is set to true in all necessary cases whenp
resolves; not a subset of those cases. This was an oversight from #141.Preview | Diff