Skip to content
33 changes: 29 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,28 @@ <h2>The <dfn>record type</dfn> string</h2>
</div>
</section>

<section><h3>Aborting pending scan operation</h3>
<div>
To attempt to <dfn>abort a pending scan operation</dfn> on an
<a>environment settings object</a>, perform the following steps:
<ol class=algorithm>
<li>
If there is no <a>pending read tuple</a> |tuple|, abort these steps.
</li>
<li>
If |tuple|'s reader has already initiated an ongoing NFC data transfer,
abort these steps.
</li>
<li>
Reject |tuple|'s promise with an {{"InvalidStateError"}} {{DOMException}}.
</li>
<li>
Clear the <a>pending read tuple</a> and abort these steps.
</li>
</ol>
</div>
</section>

<section><h3>Releasing NFC</h3>
<p>
To <dfn>release NFC</dfn> on an <a>environment settings object</a>,
Expand Down Expand Up @@ -2510,7 +2532,7 @@ <h3><dfn>Writing content</dfn></h3>
Let |records| be the list « |textRecord| ».
</li>
<li>
Set |source|'s <a>records</a> to |records|.
Set |source|'s records to |records|.
</li>
</ul>
<dt>{{BufferSource}}</dt>
Expand All @@ -2524,13 +2546,13 @@ <h3><dfn>Writing content</dfn></h3>
Let |records| be the list « |mimeRecord| ».
</li>
<li>
Set |source|'s <a>records</a> to |records|.
Set |source|'s records to |records|.
</li>
</ul>
<dt>{{NDEFMessageInit}}</dt>
<ul>
<li>
If |source|'s <a>records</a> [= list/is empty =], [= exception/throw =]
If |source|'s records [= list/is empty =], [= exception/throw =]
a {{TypeError}} and abort these steps.
</li>
</ul>
Expand All @@ -2548,7 +2570,7 @@ <h3><dfn>Writing content</dfn></h3>
</li>
<li>
[= list/For each =] |record:NDEFRecordInit| in the <a>list</a>
|source|'s <a>records</a>, run the following steps:
|source|'s records, run the following steps:
<ol>
<li>
Let |ndef| be the result of running <a>create NDEF record</a>
Expand Down Expand Up @@ -3419,6 +3441,9 @@ <h3><dfn>Writing content</dfn></h3>
browsing context</a>, then reject |p| with and
{{"InvalidStateError"}} {{DOMException}} and return |p|.
</li>
<li>
Attempt to <a>abort a pending scan operation</a>.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here, we should return |p| with rejected promise if failing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we just reject the pending scan, not this one. It's a cleanup operation.
Or do you mean if the abort fails, we should reject the scan?
i.e. should we handle the "ongoing operation" step as a fail to abort and propagate it up?

</li>
<li>
Let |reader:NDEFReader| be the {{NDEFReader}} instance.
</li>
Expand Down