Skip to content

Commit 636fadd

Browse files
committed
Handle non-fully-active documents
1 parent 3bc95bf commit 636fadd

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

‎index.html

+17-8
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ <h4>
172172
|data:ShareData|, run the following steps:
173173
</p>
174174
<ol class="algorithm">
175-
<li>If the [=current settings object=]'s [=environment settings
176-
object/responsible document=] is not [=allowed to use=]
175+
<li>Let |document:Document| be the [=current settings object=]'s
176+
[=environment settings object/responsible document=].
177+
</li>
178+
<li>If |document| is not <a>allowed to use</a>
177179
<a>"web-share"</a>, return [=a promise rejected with=] a
178180
{{"NotAllowedError"}} {{DOMException}}.
179181
</li>
@@ -188,14 +190,14 @@ <h4>
188190
</li>
189191
<li>[=Consume user activation=] of |window|.
190192
</li>
191-
<li>Let |base:URL| be [=this=]'s <a>relevant settings object</a>'s
192-
[=environment settings object/API base URL=].
193-
</li>
194-
<li>If [=validate share data=] with |data| and |base| returns
193+
<li>If [=validate share data=] with |data| and |document| returns
195194
false, then return [=a promise rejected with=] a {{TypeError}}.
196195
</li>
197196
<li>If |data|'s {{ShareData/url}} member is present:
198197
<ol>
198+
<li>Let |base:URL| be [=this=]'s <a>relevant settings
199+
object</a>'s [=environment settings object/API base URL=].
200+
</li>
199201
<li>Let |url:URL| be the result of running the <a>URL
200202
parser</a> on |data|'s {{ShareData/url}} with |base|.
201203
</li>
@@ -302,7 +304,7 @@ <h3>
302304
</li>
303305
<li>Return the result of [=validate share data=] with |data| and
304306
[=this=]'s [=relevant settings object=]'s [=environment settings
305-
object/API base URL=].
307+
object/responsible document=].
306308
</li>
307309
</ol>
308310
</section>
@@ -312,9 +314,13 @@ <h3>
312314
</h3>
313315
<p>
314316
To <dfn>validate share data</dfn> with |data:ShareData| and
315-
|base:URL|, run the following steps:
317+
|document:Document|, run the following steps. The algorithm runs in
318+
the [=this=] context from where it is invoked (i.e. {{Navigator}}
319+
instance):
316320
</p>
317321
<ol class="algorithm">
322+
<li>If |document| is not [=Document/fully active=], return false.
323+
</li>
318324
<li>If none of |data|'s members {{ShareData/title}},
319325
{{ShareData/text}}, or {{ShareData/url}} or {{ShareData/files}} are
320326
present, return false.
@@ -345,6 +351,9 @@ <h3>
345351
</li>
346352
<li>If |data|'s {{ShareData/url}} member is present:
347353
<ol>
354+
<li>Let |base:URL| be [=this=]'s <a>relevant settings
355+
object</a>'s [=environment settings object/API base URL=].
356+
</li>
348357
<li>Let |url:URL| be the result of running the [=URL parser=]
349358
on |data|'s {{ShareData/url}} member, with |base|, and no
350359
encoding override.

0 commit comments

Comments
 (0)