Skip to content

Handle non-fully-active documents #219

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

Merged
merged 2 commits into from
Sep 13, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Do check earlier
  • Loading branch information
marcoscaceres committed Sep 9, 2021
commit 6884cce3b2fb4bb162ed64c24ef0e74f2c51197c
36 changes: 17 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,13 @@ <h4>
<li>Let |document:Document| be the [=current settings object=]'s
[=environment settings object/responsible document=].
</li>
<li>If |document| is not <a>allowed to use</a>
<a>"web-share"</a>, return [=a promise rejected with=] a
{{"NotAllowedError"}} {{DOMException}}.
<li>If |document| is not [=Document/fully active=], return [=a
promise rejected with=] an {{"InvalidStateError"}}
{{DOMException}}.
</li>
<li>If |document| is not <a>allowed to use</a> <a>"web-share"</a>,
return [=a promise rejected with=] a {{"NotAllowedError"}}
{{DOMException}}.
</li>
<li>If [=this=].{{Navigator/[[sharePromise]]}} is not `null`,
return [=a promise rejected with=] an {{"InvalidStateError"}}
Expand All @@ -190,14 +194,14 @@ <h4>
</li>
<li>[=Consume user activation=] of |window|.
</li>
<li>If [=validate share data=] with |data| and |document| returns
<li>Let |base:URL| be [=this=]'s <a>relevant settings object</a>'s
[=environment settings object/API base URL=].
</li>
<li>If [=validate share data=] with |data| and |base| returns
false, then return [=a promise rejected with=] a {{TypeError}}.
</li>
<li>If |data|'s {{ShareData/url}} member is present:
<ol>
<li>Let |base:URL| be [=this=]'s <a>relevant settings
object</a>'s [=environment settings object/API base URL=].
</li>
<li>Let |url:URL| be the result of running the <a>URL
parser</a> on |data|'s {{ShareData/url}} with |base|.
</li>
Expand Down Expand Up @@ -298,13 +302,14 @@ <h3>
{{ShareData}} |data:ShareData|, run the following steps:
</p>
<ol class="algorithm">
<li>If the [=current settings object=]'s [=environment settings
object/responsible document=] is not <a>allowed to use</a>
<a>"web-share"</a>, return false.
<li>Let |document:Document| be the [=current settings object=]'s
[=environment settings object/responsible document=].
</li>
<li>If |document| is not [=Document/fully active=], return false.
</li>
<li>Return the result of [=validate share data=] with |data| and
[=this=]'s [=relevant settings object=]'s [=environment settings
object/responsible document=].
object/API base URL=].
</li>
</ol>
</section>
Expand All @@ -314,13 +319,9 @@ <h3>
</h3>
<p>
To <dfn>validate share data</dfn> with |data:ShareData| and
|document:Document|, run the following steps. The algorithm runs in
the [=this=] context from where it is invoked (i.e. {{Navigator}}
instance):
|base:URL|, run the following steps:
</p>
<ol class="algorithm">
<li>If |document| is not [=Document/fully active=], return false.
</li>
<li>If none of |data|'s members {{ShareData/title}},
{{ShareData/text}}, or {{ShareData/url}} or {{ShareData/files}} are
present, return false.
Expand Down Expand Up @@ -351,9 +352,6 @@ <h3>
</li>
<li>If |data|'s {{ShareData/url}} member is present:
<ol>
<li>Let |base:URL| be [=this=]'s <a>relevant settings
object</a>'s [=environment settings object/API base URL=].
</li>
<li>Let |url:URL| be the result of running the [=URL parser=]
on |data|'s {{ShareData/url}} member, with |base|, and no
encoding override.
Expand Down