Skip to content

fix: ReSpec link warnings #54

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 9 commits into from
Nov 30, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

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
Next Next commit
Fixup exceptions
  • Loading branch information
marcoscaceres committed Nov 27, 2017
commit 686ec24810e55a7982f77b54857adcf817da316a
83 changes: 48 additions & 35 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ <h3>
</pre>
<div class="note">
The <var>data</var> argument is marked as "optional", but it is
effectively required; <a>share()</a> will throw a <a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a> if called
with no arguments. WebIDL <a data-cite=
effectively required; <a>share()</a> will throw a <a>TypeError</a> if
called with no arguments. WebIDL <a data-cite=
"!WEBIDL#idl-operations">mandates that it be optional</a> because the
dictionary members are all optional. See WebIDL <a href=
"https://github.com/heycam/webidl/issues/130">Issue #130</a>.
Expand Down Expand Up @@ -126,9 +125,8 @@ <h4>
"!promises-guide#a-new-promise">a new promise</a>.
</li>
<li>If none of <var>data</var>'s members <a>title</a>, <a>text</a>,
or <a>url</a> are present, reject <var>p</var> with <a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a>, and
abort these steps.
or <a>url</a> are present, reject <var>p</var> with
<a>TypeError</a>, and abort these steps.
</li>
<li>If <var>data</var>'s <a>url</a> member is <a data-cite=
"!WEBIDL#dfn-present">present</a>:
Expand All @@ -145,9 +143,7 @@ <h4>
</li>
<li>If <var>url</var> is failure, <a data-cite=
"!promises-guide#reject-promise">reject</a> <var>p</var> with
<a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a>,
and abort these steps.
<a>TypeError</a>, and abort these steps.
</li>
<li>Set <var>data</var> to a copy of <var>data</var>, with its
<a>url</a> field set to the result of running the
Expand All @@ -159,19 +155,16 @@ <h4>
<li>If the method call was not <a data-cite=
"!HTML#triggered-by-user-activation">triggered by user
activation</a>, <a data-cite=
"!promises-guide#reject-promise">reject</a> <var>p</var> with
<a data-cite=
"!WEBIDL#notallowederror"><code>NotAllowedError</code></a>, and
abort these steps.
"!promises-guide#reject-promise">reject</a> <var>p</var> with a
"<a>NotAllowedError</a>" <a>DOMException</a>, and abort these steps.
</li>
<li>
<a data-cite="!HTML#in-parallel">In parallel</a>:
<ol>
<li>If there are no <a>share targets</a> available,
<a data-cite="!promises-guide#reject-promise">reject</a> <var>
p</var> with <a data-cite=
"!WEBIDL#aborterror"><code>AbortError</code></a>, and abort
these steps.
p</var> with "<a>AbortError</a>" <a>DOMException</a>, and
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarified that "AbortError" isn't an error class, it's a DOMException type. Same with "NotAllowedError".

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Can you be consistent with NotAllowedError and say "an "AbortError" DOMException" (i.e., add "an" in front of AbortError).

abort these steps.
</li>
<li>Present the user with a choice of one or more <a>share
targets</a>, selected at the user agent's discretion. The user
Expand All @@ -180,18 +173,16 @@ <h4>
</li>
<li>If the user chose to cancel the share operation,
<a data-cite="!promises-guide#reject-promise">reject</a> <var>
p</var> with <a data-cite=
"!WEBIDL#aborterror"><code>AbortError</code></a>, and abort
these steps.
p</var> with "<a>AbortError</a>" <a>DOMException</a>, and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"an"

abort these steps.
</li>
<li>Activate the chosen <a>share target</a>, <a>convert
<var>data</var> to a format suitable for ingestion into the
target</a>, and transmit the converted data to the target. If
an error occurs starting the target or transmitting the data,
<a data-cite="!promises-guide#reject-promise">reject</a> <var>
p</var> with <a data-cite=
"!WEBIDL#aborterror"><code>AbortError</code></a>, and abort
these steps.
p</var> with "<a>AbortError</a>" <a>DOMException</a>, and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"an"

abort these steps.
</li>
<li>Once the data has been successfully transmitted to the
target, <a data-cite=
Expand Down Expand Up @@ -348,6 +339,31 @@ <h3>
</p>
</section>
</section>
<section>
<h2>
Dependencies
</h2>
<p>
The following are defined in [[!WEBIDL]]:
</p>
<ul data-sort="">
<li>
<code><dfn data-cite=
"!WEBIDL#exceptiondef-typeerror">TypeError</dfn></code>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could instead link to https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror which is where TypeError is actually defined? WebIDL just refers to that. Maybe web specs don't normally directly link to ECMA-262. This is fine also.

</li>
<li>
<code><dfn data-cite=
"WEBIDL#dfn-DOMException">DOMException</dfn></code>
</li>
<li>
<code><dfn data-cite="!WEBIDL#aborterror">AbortError</dfn></code>
</li>
<li>
<code><dfn data-cite=
"!WEBIDL#notallowederror">NotAllowedError</dfn></code>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the period at the end here. (Or add periods to all of them.)

</li>
</ul>
</section>
<section class="informative">
<h2>
Security and privacy considerations
Expand Down Expand Up @@ -427,19 +443,16 @@ <h2>
members. Web Share will use the mechanism produced by that discussion.
</div>
<p data-link-for="Navigator">
The <a>share()</a> method throws a <a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a> if none of
the specified members are present. The intention is that when a new
member is added, it will also be added to this list of recognized
members (so as to not throw an error). This is for future-proofing
implementations: if a web site written against a future version of this
spec uses <em>only</em> new members (<i>e.g.</i>,
<code>navigator.share({image: x})</code>), it will be valid in future
user agents, but a <a data-cite=
"!WEBIDL#exceptiondef-typeerror"><code>TypeError</code></a> on user
agents implementing an older version of the spec. Developers will be
asked to feature-detect any new fields they rely on, to avoid having
errors surface in their program.
The <a>share()</a> method throws a <a>TypeError</a> if none of the
specified members are present. The intention is that when a new member
is added, it will also be added to this list of recognized members (so
as to not throw an error). This is for future-proofing implementations:
if a web site written against a future version of this spec uses
<em>only</em> new members (<i>e.g.</i>, <code>navigator.share({image:
x})</code>), it will be valid in future user agents, but a
<a>TypeError</a> on user agents implementing an older version of the
spec. Developers will be asked to feature-detect any new fields they
rely on, to avoid having errors surface in their program.
</p>
<p>
Editors of this spec will want to carefully consider the genericity of
Expand Down