Fix requestStorageAccess to set bool to true before resolving#166
Fix requestStorageAccess to set bool to true before resolving#166cfredric wants to merge 2 commits intoprivacycg:mainfrom
requestStorageAccess to set bool to true before resolving#166Conversation
requestStorageAccess to always set bool to true before resolvingrequestStorageAccess to set bool to true before resolving
| 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.
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.
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.
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.
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
requestStorageAccessalgorithm so thatglobal'shas storage accessis set to true in all necessary cases whenpresolves; not a subset of those cases. This was an oversight from #141.Preview | Diff