From 4d6b751eb2e9eff30dbe996ea0c164cf6116fe98 Mon Sep 17 00:00:00 2001 From: cfredric Date: Wed, 15 Feb 2023 12:21:17 -0500 Subject: [PATCH 1/2] Fix requestStorageAccess to always set bool before resolving --- storage-access.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage-access.bs b/storage-access.bs index 84359de..87ca260 100644 --- a/storage-access.bs +++ b/storage-access.bs @@ -156,7 +156,7 @@ When invoked on {{Document}} |doc|, the ha 1. If |doc|'s [=Document/browsing context=] is a [=top-level browsing context=], [=/resolve=] |p| with true and return |p|. 1. If the [=top-level origin=] of |doc|'s [=relevant settings object=] is an [=opaque origin=], [=/resolve=] |p| with false and return |p|. 1. If |doc|'s [=Document/origin=] is [=same origin=] with the [=top-level origin=] of |doc|'s [=relevant settings object=], [=/resolve=] |p| with true and return |p|. -1. [=Queue a global task=] on the [=permissions task source=] given |global| to [=/resolve=] |p| with |global's| [=environment/has storage access=]. +1. [=Queue a global task=] on the [=permissions task source=] given |global| to [=/resolve=] |p| with |global|'s [=environment/has storage access=]. 1. Return |p|. ISSUE: Shouldn't step 8 be [=same site=]? @@ -169,11 +169,11 @@ When invoked on {{Document}} |doc|, the re 1. If |doc| is not [=Document/fully active=], then [=/reject=] |p| with an "{{InvalidStateError}}" {{DOMException}} and return |p|. 1. Let |global| be |doc|'s [=relevant global object=]. 1. If |global| is not a [=secure context=], then [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. -1. If |doc|'s [=Document/browsing context=] is a [=top-level browsing context=], [=/resolve=] and return |p|. +1. If |doc|'s [=Document/browsing context=] is a [=top-level browsing context=], set |global|'s [=environment/has storage access=] to true, then [=/resolve=] and return |p|. 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|. 1. If |doc|'s [=active sandboxing flag set=] has its [=sandbox storage access by user activation flag=] set, [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. 1. If |global|'s [=environment/has storage access=] is true, [=/resolve=] |p| with {{undefined}} and return. 1. Let |has transient activation| be whether |doc|'s {{Window}} object has [=transient activation=]. From 7f8db50e18406d3d2bf1a109c63f82997fcbeab7 Mon Sep 17 00:00:00 2001 From: cfredric Date: Wed, 15 Feb 2023 13:43:18 -0500 Subject: [PATCH 2/2] Remove boolean-set for top-level contexts --- storage-access.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage-access.bs b/storage-access.bs index 87ca260..f6fcb52 100644 --- a/storage-access.bs +++ b/storage-access.bs @@ -169,7 +169,7 @@ When invoked on {{Document}} |doc|, the re 1. If |doc| is not [=Document/fully active=], then [=/reject=] |p| with an "{{InvalidStateError}}" {{DOMException}} and return |p|. 1. Let |global| be |doc|'s [=relevant global object=]. 1. If |global| is not a [=secure context=], then [=/reject=] |p| with a "{{NotAllowedError}}" {{DOMException}} and return |p|. -1. If |doc|'s [=Document/browsing context=] is a [=top-level browsing context=], set |global|'s [=environment/has storage access=] to true, then [=/resolve=] and return |p|. +1. If |doc|'s [=Document/browsing context=] is a [=top-level browsing context=], [=/resolve=] and return |p|. 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|.