@@ -1135,13 +1135,13 @@ <h4>
1135
1135
< section > < h3 > Handle scanning errors</ h3 >
1136
1136
< p >
1137
1137
This example shows what happens when {{NDEFReader/scan}} promise rejects and
1138
- {{NDEFReader/onerror }} is fired.
1138
+ {{NDEFReader/onreadingerror }} is fired.
1139
1139
</ p >
1140
1140
< pre class ="example ">
1141
1141
const ndef = new NDEFReader();
1142
1142
ndef.scan().then(() => {
1143
1143
console.log("Scan started successfully.");
1144
- ndef.onerror = event => {
1144
+ ndef.onreadingerror = event => {
1145
1145
console.log("Error! Cannot read data from the NFC tag. Try a different one?");
1146
1146
};
1147
1147
ndef.onreading = event => {
@@ -1988,7 +1988,7 @@ <h2>The <dfn>record type</dfn> string</h2>
1988
1988
interface NDEFReader : EventTarget {
1989
1989
constructor();
1990
1990
1991
- attribute EventHandler onerror ;
1991
+ attribute EventHandler onreadingerror ;
1992
1992
attribute EventHandler onreading;
1993
1993
1994
1994
Promise<undefined> scan(optional NDEFScanOptions options={});
@@ -2079,7 +2079,7 @@ <h2>The <dfn>record type</dfn> string</h2>
2079
2079
which is called to notify that new reading is available.
2080
2080
</ p >
2081
2081
< p >
2082
- The < dfn data-dfn-for ="NDEFReader "> onerror </ dfn > is an {{EventHandler}}
2082
+ The < dfn data-dfn-for ="NDEFReader "> onreadingerror </ dfn > is an {{EventHandler}}
2083
2083
which is called to notify that an error happened during reading.
2084
2084
</ p >
2085
2085
< section > < h3 > NFC state associated with the settings object</ h3 >
@@ -2109,10 +2109,11 @@ <h2>The <dfn>record type</dfn> string</h2>
2109
2109
</ td >
2110
2110
</ tr >
2111
2111
< tr >
2112
- < td > < dfn > [[\ActivatedReaderList ]]</ dfn > </ td >
2112
+ < td > < dfn > [[\PendingRead ]]</ dfn > </ td >
2113
2113
< td > empty < a > set</ a > </ td >
2114
2114
< td >
2115
- A < a > set</ a > of {{NDEFReader}} instances.
2115
+ A <|promise:Promise|, |reader:NDEFReader|> tuple where |promise|
2116
+ holds a {{Promise}} and |reader| holds an {{NDEFReader}}.
2116
2117
</ td >
2117
2118
</ tr >
2118
2119
< tr >
@@ -2126,8 +2127,8 @@ <h2>The <dfn>record type</dfn> string</h2>
2126
2127
</ tbody >
2127
2128
</ table >
2128
2129
< p >
2129
- The < dfn > activated reader objects </ dfn > is the value of the
2130
- < a > [[\ActivatedReaderList ]]</ a > internal slot.
2130
+ The < dfn > pending read tuple </ dfn > is the value of the
2131
+ < a > [[\PendingRead ]]</ a > internal slot.
2131
2132
</ p >
2132
2133
< p >
2133
2134
The < dfn > pending write tuple</ dfn > is the value of the
@@ -2270,7 +2271,7 @@ <h2>The <dfn>record type</dfn> string</h2>
2270
2271
Stop the < a > dispatch NFC content</ a > steps.
2271
2272
</ li >
2272
2273
< li >
2273
- Clear the < a > activated reader objects </ a > .
2274
+ Clear the < a > pending read tuple </ a > .
2274
2275
</ li >
2275
2276
< li >
2276
2277
Release the NFC resources associated with |nfc| on the
@@ -3421,9 +3422,9 @@ <h3><dfn>Writing content</dfn></h3>
3421
3422
accessible to the client.
3422
3423
</ p >
3423
3424
< p >
3424
- If there are any {{NDEFReader}} instances in < a > activated reader objects </ a >
3425
- then the < a > UA</ a > MUST listen to < a > NDEF message </ a > s on all connected
3426
- NFC adapters.
3425
+ If there is a < a > pending read tuple </ a > whose |reader| is an
3426
+ {{NDEFReader}} instance, then the < a > UA</ a > MUST listen to
3427
+ < a > NDEF message </ a > s on all connected NFC adapters.
3427
3428
</ p >
3428
3429
3429
3430
< section > < h3 > The < strong > scan()</ strong > method</ h3 >
@@ -3464,12 +3465,10 @@ <h3><dfn>Writing content</dfn></h3>
3464
3465
abort steps</ a > to |reader|.< a > [[\ScanAbortSignal]]</ a > :
3465
3466
< ol >
3466
3467
< li >
3467
- Remove the {{NDEFReader}} instance from the
3468
- < a > activated reader objects</ a > .
3468
+ Clear the < a > pending read tuple</ a > .
3469
3469
</ li >
3470
3470
< li >
3471
- If the < a > activated reader objects</ a > [= list/is empty =],
3472
- then make a request to stop listening to < a > NDEF message</ a > s
3471
+ Make a request to stop listening to < a > NDEF message</ a > s
3473
3472
on all < a > NFC adapter</ a > s.
3474
3473
</ li >
3475
3474
</ ol >
@@ -3495,7 +3494,7 @@ <h3><dfn>Writing content</dfn></h3>
3495
3494
and abort these steps.
3496
3495
</ li >
3497
3496
< li >
3498
- Add |reader| to the < a > activated reader objects </ a > .
3497
+ Set the < a > pending read tuple </ a > to (|p|, |reader|) .
3499
3498
</ li >
3500
3499
< li >
3501
3500
Resolve |p|.
@@ -3520,14 +3519,10 @@ <h3><dfn>Writing content</dfn></h3>
3520
3519
If the < a > NFC tag</ a > in proximity range does not expose < a > NDEF</ a >
3521
3520
technology for reading or formatting, run the following sub-steps:
3522
3521
< ol >
3523
- < li > [= list/For each =]
3524
- {{NDEFReader}} instance |reader:NDEFReader| in the
3525
- < a > activated reader objects</ a > , run the following sub-steps:
3526
- < ol >
3527
- < li >
3528
- < a > Fire an event</ a > named "`error`" at |reader|.
3529
- </ li >
3530
- </ ol >
3522
+ < li >
3523
+ If there is a < a > pending read tuple</ a > whose |reader| is an
3524
+ {{NDEFReader}} instance, fire an event</ a > named "`readingerror`" at
3525
+ |reader|.
3531
3526
</ li >
3532
3527
< li >
3533
3528
Abort these steps.
@@ -3594,16 +3589,11 @@ <h3><dfn>Writing content</dfn></h3>
3594
3589
</ p >
3595
3590
< ol class =algorithm >
3596
3591
< li >
3597
- [= list/For each =] {{NDEFReader}} instance |reader:NDEFReader| in
3598
- the < a > activated reader objects</ a > ,
3599
- < ol >
3600
- < li >
3601
- < a > fire an event</ a > named "`reading`" at |reader| using
3602
- < a > NDEFReadingEvent</ a > with its < a > serialNumber</ a > attribute
3603
- initialized to |serialNumber| and < a > message</ a > attribute
3604
- initialized to |message|.
3605
- </ li >
3606
- </ ol >
3592
+ If there is a < a > pending read tuple</ a > whose |reader| is an
3593
+ {{NDEFReader}} instance, < a > fire an event</ a > named "`reading`" at
3594
+ |reader| using < a > NDEFReadingEvent</ a > with its < a > serialNumber</ a >
3595
+ attribute initialized to |serialNumber| and < a > message</ a > attribute
3596
+ initialized to |message|.
3607
3597
</ li >
3608
3598
</ ol >
3609
3599
</ section >
0 commit comments