@@ -2079,11 +2079,10 @@ <h2>The <dfn>record type</dfn> string</h2>
2079
2079
</ td >
2080
2080
</ tr >
2081
2081
< tr >
2082
- < td > < dfn > [[\PendingRead ]]</ dfn > </ td >
2082
+ < td > < dfn > [[\ActivatedReaderList ]]</ dfn > </ td >
2083
2083
< td > empty < a > set</ a > </ td >
2084
2084
< td >
2085
- A <|promise:Promise|, |reader:NDEFReader|> tuple where |promise|
2086
- holds a {{Promise}} and |reader| holds an {{NDEFReader}}.
2085
+ A < a > set</ a > of {{NDEFReader}} instances.
2087
2086
</ td >
2088
2087
</ tr >
2089
2088
< tr >
@@ -2097,8 +2096,8 @@ <h2>The <dfn>record type</dfn> string</h2>
2097
2096
</ tbody >
2098
2097
</ table >
2099
2098
< p >
2100
- The < dfn > pending read tuple </ dfn > is the value of the
2101
- < a > [[\PendingRead ]]</ a > internal slot.
2099
+ The < dfn > activated reader objects </ dfn > is the value of the
2100
+ < a > [[\ActivatedReaderList ]]</ a > internal slot.
2102
2101
</ p >
2103
2102
< p >
2104
2103
The < dfn > pending write tuple</ dfn > is the value of the
@@ -2225,31 +2224,6 @@ <h2>The <dfn>record type</dfn> string</h2>
2225
2224
</ div >
2226
2225
</ section >
2227
2226
2228
- < section > < h3 > Aborting pending scan operation</ h3 >
2229
- < div >
2230
- To attempt to < dfn > abort a pending scan operation</ dfn > ,
2231
- run the following steps:
2232
- < ol class =algorithm >
2233
- < li >
2234
- If there is no < a > pending read tuple</ a > |tuple|, abort these steps.
2235
- </ li >
2236
- < li >
2237
- If |tuple|'s reader has already initiated an ongoing NFC data transfer,
2238
- abort these steps.
2239
- </ li >
2240
- < li >
2241
- Reject |tuple|'s promise with an {{"InvalidStateError"}} {{DOMException}}.
2242
- </ li >
2243
- < li >
2244
- Stop the < a > dispatch NFC content</ a > steps.
2245
- </ li >
2246
- < li >
2247
- Clear the < a > pending read tuple</ a > .
2248
- </ li >
2249
- </ ol >
2250
- </ div >
2251
- </ section >
2252
-
2253
2227
< section > < h3 > Releasing NFC</ h3 >
2254
2228
< p >
2255
2229
To < dfn > release NFC</ dfn > on an < a > environment settings object</ a > ,
@@ -2263,7 +2237,7 @@ <h2>The <dfn>record type</dfn> string</h2>
2263
2237
Attempt to < a > abort a pending write operation</ a > .
2264
2238
</ li >
2265
2239
< li >
2266
- Attempt to < a > abort a pending scan operation </ a > .
2240
+ Clear the < a > activated reader objects </ a > .
2267
2241
</ li >
2268
2242
< li >
2269
2243
Release the NFC resources on the underlying platform.
@@ -3418,9 +3392,9 @@ <h3><dfn>Writing content</dfn></h3>
3418
3392
accessible to the client.
3419
3393
</ p >
3420
3394
< p >
3421
- If there is a < a > pending read tuple </ a > whose |reader| is an
3422
- {{NDEFReader}} instance, then the < a > UA</ a > MUST listen to
3423
- < a > NDEF message </ a > s on all connected NFC adapters.
3395
+ If there are any {{NDEFReader}} instances in < a > activated reader objects </ a >
3396
+ then the < a > UA</ a > MUST listen to < a > NDEF message </ a > s on all connected
3397
+ NFC adapters.
3424
3398
</ p >
3425
3399
3426
3400
< section > < h3 > The < strong > scan()</ strong > method</ h3 >
@@ -3440,15 +3414,6 @@ <h3><dfn>Writing content</dfn></h3>
3440
3414
browsing context</ a > , then reject |p| with an
3441
3415
{{"InvalidStateError"}} {{DOMException}} and return |p|.
3442
3416
</ li >
3443
- < li >
3444
- If there is a < a > pending read tuple</ a > |tuple|, then reject |p|
3445
- with an {{"InvalidStateError"}} {{DOMException}} and return |p|.
3446
- < p class ="note ">
3447
- Note that scans need to be explicitly aborted before a new scan
3448
- could be done, and this behavior is different from writes, which
3449
- automatically abort and replace pending writes.
3450
- </ p >
3451
- </ li >
3452
3417
< li >
3453
3418
Let |reader:NDEFReader| be the {{NDEFReader}} instance.
3454
3419
</ li >
@@ -3466,23 +3431,25 @@ <h3><dfn>Writing content</dfn></h3>
3466
3431
< li >
3467
3432
If |signal| is not `null`, then
3468
3433
< a data-cite ="dom#abortsignal-abort-algorithms ">
3469
- add the following abort steps</ a > to |signal|:
3470
- < ol >
3471
- < li >
3472
- Clear the < a > pending read tuple</ a > .
3473
- </ li >
3474
- < li >
3475
- Make a request to stop listening to < a > NDEF message</ a > s
3476
- on all < a > NFC adapter</ a > s.
3477
- </ li >
3478
- </ ol >
3434
+ add the following < dfn > abort the pending scans</ dfn > steps</ a >
3435
+ to |signal|:
3436
+ < ol >
3437
+ < li >
3438
+ Remove |reader| from the < a > activated reader objects</ a > .
3439
+ </ li >
3440
+ < li >
3441
+ If the < a > activated reader objects</ a > [= list/is empty =],
3442
+ then make a request to stop listening to < a > NDEF message</ a > s
3443
+ on all < a > NFC adapter</ a > s.
3444
+ </ li >
3445
+ </ ol >
3479
3446
</ li >
3480
3447
< li >
3481
3448
[=promise/React=] to |p|:
3482
3449
< ol >
3483
3450
< li >
3484
- If |p| was settled (fulfilled or rejected), then clear the
3485
- < a > pending read tuple </ a > .
3451
+ If |p| was settled (fulfilled or rejected), then
3452
+ < a > abort the pending scans </ a > .
3486
3453
</ li >
3487
3454
</ ol >
3488
3455
</ li >
@@ -3507,7 +3474,7 @@ <h3><dfn>Writing content</dfn></h3>
3507
3474
and abort these steps.
3508
3475
</ li >
3509
3476
< li >
3510
- Set the < a > pending read tuple </ a > to (|p|, |reader|) .
3477
+ Add |reader| to the < a > activated reader objects </ a > .
3511
3478
</ li >
3512
3479
< li >
3513
3480
Resolve |p|.
@@ -3532,10 +3499,14 @@ <h3><dfn>Writing content</dfn></h3>
3532
3499
If the < a > NFC tag</ a > in proximity range does not expose < a > NDEF</ a >
3533
3500
technology for reading or formatting, run the following sub-steps:
3534
3501
< ol >
3535
- < li >
3536
- If there is a < a > pending read tuple</ a > whose |reader| is an
3537
- {{NDEFReader}} instance, fire an event</ a > named "`readingerror`" at
3538
- |reader|.
3502
+ < li > [= list/For each =]
3503
+ {{NDEFReader}} instance |reader:NDEFReader| in the
3504
+ < a > activated reader objects</ a > , run the following sub-steps:
3505
+ < ol >
3506
+ < li >
3507
+ < a > Fire an event</ a > named "`error`" at |reader|.
3508
+ </ li >
3509
+ </ ol >
3539
3510
</ li >
3540
3511
< li >
3541
3512
Abort these steps.
@@ -3602,11 +3573,16 @@ <h3><dfn>Writing content</dfn></h3>
3602
3573
</ p >
3603
3574
< ol class =algorithm >
3604
3575
< li >
3605
- If there is a < a > pending read tuple</ a > whose |reader| is an
3606
- {{NDEFReader}} instance, < a > fire an event</ a > named "`reading`" at
3607
- |reader| using < a > NDEFReadingEvent</ a > with its < a > serialNumber</ a >
3608
- attribute initialized to |serialNumber| and < a > message</ a > attribute
3609
- initialized to |message|.
3576
+ [= list/For each =] {{NDEFReader}} instance |reader:NDEFReader| in
3577
+ the < a > activated reader objects</ a > ,
3578
+ < ol >
3579
+ < li >
3580
+ < a > fire an event</ a > named "`reading`" at |reader| using
3581
+ < a > NDEFReadingEvent</ a > with its < a > serialNumber</ a > attribute
3582
+ initialized to |serialNumber| and its < a > message</ a > attribute
3583
+ initialized to |message|.
3584
+ </ li >
3585
+ </ ol >
3610
3586
</ li >
3611
3587
</ ol >
3612
3588
</ section >
0 commit comments