Skip to content
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

Join NDEFReader and NDEFWriter #601

Merged
merged 13 commits into from
Nov 20, 2020
Merged

Conversation

zolkis
Copy link
Contributor

@zolkis zolkis commented Sep 22, 2020

Re-applying #568.


Preview | Diff

arskama added a commit to arskama/chromium that referenced this pull request Sep 22, 2020
refers to w3c/web-nfc#601

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
@beaufortfrancois
Copy link
Collaborator

Quick question: Is it clear for web developers that onerror will get fired only when scan has started.
I can see why some web developers would think this code would work.

const ndef = new NDEFReader();
ndef.onerror = event => {
  /* Was there an error while writing? */
}
ndef.write('hello world');

@zolkis
Copy link
Contributor Author

zolkis commented Sep 23, 2020

Good question, we need to clarify that with the two objects merged.

@zolkis
Copy link
Contributor Author

zolkis commented Sep 23, 2020

So should we rename onerror to onreaderror, or get rid of it alltogether and rely on the Promise, like with write()?

Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

Would you mind also updating the the EXPLAINER.md file and other files where NDEFWriter is referenced?

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@zolkis
Copy link
Contributor Author

zolkis commented Sep 24, 2020

Amended the TypeScript definition to also remove ignoreRead and scan options no longer supported.

arskama added a commit to arskama/chromium that referenced this pull request Sep 25, 2020
refers to w3c/web-nfc#601

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
@arskama
Copy link

arskama commented Sep 25, 2020

Quick question: Is it clear for web developers that onerror will get fired only when scan has started.
I can see why some web developers would think this code would work.

const ndef = new NDEFReader();
ndef.onerror = event => {
  /* Was there an error while writing? */
}
ndef.write('hello world');

@beaufortfrancois
I would like to have a clarification on your comment (it s me not understanding :) )

On the chromium implementation, there are 2 places where onerror is fired.
https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/nfc/ndef_reader.cc;l=217;drc=126a458910eb392beb0c56601c89233cd82d80b5

and

https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/modules/nfc/nfc_proxy.cc;l=122;drc=126a458910eb392beb0c56601c89233cd82d80b5

which are 2 different cases, right?
So I think we need two different handling for those, since the first one is not really a readingerror?

@zolkis
Copy link
Contributor Author

zolkis commented Sep 28, 2020

Since we merged NDEFReader (which had an onerror event) and NDEFWriter (which did not have it), someone may assume that in the joined NDEFReader onerror is also relevant to writing, which is not the case. Therefore we renamed onerror to onreadingerror.

In the impl onerror conveys the NFC read errors (either due to access problems, or technical faults) to the readers.

Looks like since filters are gone, we have only one reader, and NFCProxy could be simplified (readers_ removed etc), in conformance with the new internal slots (PendingReader instead of ActivatedReaderList) of NDEFReader.

@beaufortfrancois
Copy link
Collaborator

Argh I see now... You're right @arskama, the first one "NDEFReader::OnMojoConnectionError()" is not per-say a reading error but an internal communication issue that can happen in Chromium.
If I remember correctly though, there's no way to recover from this.

The old behaviour still triggered an error even though it was NOT specifically a reading error.

With that in mind, maybe keeping onerror makes sense.
For info, this will also get triggered if an internal error happens during a write NFC operation and write() promise will reject as well...

Let's keep onerror.
What do you folks think?

@zolkis
Copy link
Contributor Author

zolkis commented Sep 28, 2020

Let's keep onerror. What do you folks think?

So that error could have happened with the write(), too.
When does that error come up typically? Can we handle that via the scan() and write() promise?

@zolkis
Copy link
Contributor Author

zolkis commented Sep 28, 2020

"NDEFReader::OnMojoConnectionError()" is not per-say a reading error but an internal communication issue that can happen in Chromium.

Do I read that correctly: it seems to reject the promise with that error and also fire an onerror? Is the latter needed?
Edit: it's covering the case the error comes after the promise is settled. But does that actually (typically) happen?

@beaufortfrancois
Copy link
Collaborator

Let's keep onerror. What do you folks think?

So that error could have happened with the write(), too.
When does that error come up typically? Can we handle that via the scan() and write() promise?

scan will succeed when scan has started successfully, but this error could happen way after.
re: write, it won't be an issue as if this error happens, the promise will reject right away, and the onerror event will also get fired.

"NDEFReader::OnMojoConnectionError()" is not per-say a reading error but an internal communication issue that can happen in Chromium.

Do I read that correctly: it seems to reject the promise with that error and also fire an onerror? Is the latter needed?
Edit: it's covering the case the error comes after the promise is settled. But does that actually (typically) happen?

it is an internal issue which "shouldn't" happen but can happen.

@zolkis
Copy link
Contributor Author

zolkis commented Sep 28, 2020

OK, I will add a commit the revert to onerror and explain the behavior for reading and writing.

@zolkis
Copy link
Contributor Author

zolkis commented Sep 29, 2020

Question, @beaufortfrancois @kenchris

With filters gone, we can still create multiple NDEFReader instances, each of which has a scan() method that operate on the same NFC HW and have an onreading event that can take callbacks.

How should we handle this?

  1. Allow all the NDEFReader object instances, but keep a single reader in the internal slot and add the event listeners to its event.
  2. Allow all the object instance, and keep all of these in the activated reader list. In the impl, there is a single NFC proxy, though.
  3. Allow a single instance of NDEFReader in the given context and decide how to expose it: provide a getter/factory method for it, or let it be a static object, e.g. navigator.nfc (we used to be there).

@zolkis
Copy link
Contributor Author

zolkis commented Oct 12, 2020

Sorry, I needed to amend since I forgot to update the explainer and the TS definitions.
So, as agreed, now there is only one NDEFReader object that is accessed via navigator.nfc.ndef.
NFC state could be also moved to the navigator.nfc object, but for the moment it looked good on the settings object.
However, I moved all relevant content (NFC state, handling NFC adapters, obtaining permission, handling visibility change. releasing NFC) under navigator.nfc.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 13, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

Here's my first feedback to get your thoughts.

EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
index.html Show resolved Hide resolved
index.html Outdated
accepted by the {{NDEFWriter/write()}} method.
<p>The
<dfn>ndef</dfn> property is an {{NDEFReader}} object that provides
<a>NDEF</a> tag read and write functionality.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we use NFC tags consistently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, changed. I was thinking not all NFC tags were NDEF, so using "NDEF tag" was more appropriate for NDEFReader.

web-nfc.d.ts Outdated Show resolved Hide resolved
web-nfc.d.ts Outdated Show resolved Hide resolved
@beaufortfrancois
Copy link
Collaborator

What does happen with code below?

const promise1 = navigator.nfc.ndef.scan();
const promise2 = navigator.nfc.ndef.scan();

Which promise1 of promise2 reject?
It is not clear to me.

Same for write()...

Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

We shall update Separate objects vs navigator.nfc and Separate objects for reader/writer sections in EXPLAINER.md

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 14, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
@zolkis
Copy link
Contributor Author

zolkis commented Oct 14, 2020

Summarized the discussion about constructors vs navigator.nfc in #602.
Also, some options to address remaining issues like the ones @beaufortfrancois mentioned above.

@zolkis
Copy link
Contributor Author

zolkis commented Oct 14, 2020

OK, now we have navigator.nfc that contains ndef of type NDEFReader (exposing scan(), write(), onreading, onreadingerror).

I will make a branch from here to explore option 2 from #602 comment. That is, navigator.nfc would contain ontagfound, onerror, and ndef of type NDEFReader that contains read() and write().
Scanning (NFC polling) is separated from reads, ignoreRead is not needed any more since there is no automatic content read from tags, and internal slots for pending read and write are not needed, either. Reading and dispatching algorithms become much simpler. Also, this would be closer to the Android NFC API usage flow, and more future proof.

This would permit later improvements, such as the ontagfound event could contain NFC technologies supported, but since that is restricted to NDEF at the moment, we can use a simple event. However, we could use flags already available from Android, such as writeable, formattable etc.
Future NFC tech could get their API namespace under navigator.nfc, for instance navigator.nfc.isodep exposing transceive() etc. The same navigator.nfc.ontagfound could be used (with expanded content, so backwards compatible).
Also, a navigator.nfc.ontagreleased event could be added later, if a developer need arises (it's quite common in other APIs, but will only add here when there are clear use cases for it).

The minimal delta from this point that supports the current functionality would be quite small, but let's see how

@zolkis
Copy link
Contributor Author

zolkis commented Nov 17, 2020

Reverted attaching to navigator. That version is saved in PR #605

Copy link
Collaborator

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

Here's my feedback for the explainer.
I'll now review spec changes.

EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Outdated Show resolved Hide resolved
EXPLAINER.md Show resolved Hide resolved
blueboxd pushed a commit to blueboxd/chromium-legacy that referenced this pull request Nov 20, 2020
The NDEFReader onerror event handler is renamed to onreadingerror to
make it clear to web developers that only NFC read errors will be fired
in this event as NDEFReader and NDEFWriter will soon been merged. Note
that an error message is now displayed in the devtools JS console to
help web developers to diagnose issues while it was part of the error
event before.

This CL also removes onreadingerror event fired on MojoConnectionError
as this is called if either the NFC service is unavailable in which case
NDEFReader.scan() will return a rejected promise, or when NFC permission
is revoked in which case the Permission API can be used to detect
changes.

Spec: w3c/web-nfc#601
Bug: 520391
Change-Id: I451083fb5382149e9a1e45da31e575709f190448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#829626}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 22, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 23, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 25, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 25, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 25, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 26, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 26, 2020
…readingerror, a=testonly

Automatic update from web-platform-tests
[WebNFC] Rename NDEFReader onerror to onreadingerror

The NDEFReader onerror event handler is renamed to onreadingerror to
make it clear to web developers that only NFC read errors will be fired
in this event as NDEFReader and NDEFWriter will soon been merged. Note
that an error message is now displayed in the devtools JS console to
help web developers to diagnose issues while it was part of the error
event before.

This CL also removes onreadingerror event fired on MojoConnectionError
as this is called if either the NFC service is unavailable in which case
NDEFReader.scan() will return a rejected promise, or when NFC permission
is revoked in which case the Permission API can be used to detect
changes.

Spec: w3c/web-nfc#601
Bug: 520391
Change-Id: I451083fb5382149e9a1e45da31e575709f190448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#829626}

--

wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171
wpt-pr: 26573
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 27, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 27, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this pull request Nov 27, 2020
…readingerror, a=testonly

Automatic update from web-platform-tests
[WebNFC] Rename NDEFReader onerror to onreadingerror

The NDEFReader onerror event handler is renamed to onreadingerror to
make it clear to web developers that only NFC read errors will be fired
in this event as NDEFReader and NDEFWriter will soon been merged. Note
that an error message is now displayed in the devtools JS console to
help web developers to diagnose issues while it was part of the error
event before.

This CL also removes onreadingerror event fired on MojoConnectionError
as this is called if either the NFC service is unavailable in which case
NDEFReader.scan() will return a rejected promise, or when NFC permission
is revoked in which case the Permission API can be used to detect
changes.

Spec: w3c/web-nfc#601
Bug: 520391
Change-Id: I451083fb5382149e9a1e45da31e575709f190448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#829626}

--

wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171
wpt-pr: 26573
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 27, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Nov 27, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
sylvestre pushed a commit to sylvestre/gecko-dev that referenced this pull request Nov 28, 2020
…readingerror, a=testonly

Automatic update from web-platform-tests
[WebNFC] Rename NDEFReader onerror to onreadingerror

The NDEFReader onerror event handler is renamed to onreadingerror to
make it clear to web developers that only NFC read errors will be fired
in this event as NDEFReader and NDEFWriter will soon been merged. Note
that an error message is now displayed in the devtools JS console to
help web developers to diagnose issues while it was part of the error
event before.

This CL also removes onreadingerror event fired on MojoConnectionError
as this is called if either the NFC service is unavailable in which case
NDEFReader.scan() will return a rejected promise, or when NFC permission
is revoked in which case the Permission API can be used to detect
changes.

Spec: w3c/web-nfc#601
Bug: 520391
Change-Id: I451083fb5382149e9a1e45da31e575709f190448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#829626}

--

wpt-commits: b9a7ffca3b50041dca273fb45eeb9aad931c1171
wpt-pr: 26573
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 1, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}
pull bot pushed a commit to FreddyZeng/chromium that referenced this pull request Dec 1, 2020
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 5, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 7, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094
sideshowbarker added a commit to w3c/browser-compat-data that referenced this pull request Dec 8, 2020
This change renames NDEFReader.prototype.onerror to
NDEFReader.prototype.onreadingerror, per the spec change at
w3c/web-nfc@a71bff9
(w3c/web-nfc#601).
ddbeck pushed a commit to mdn/browser-compat-data that referenced this pull request Dec 10, 2020
…error (#7613)

* Rename NDEFReader.p.onerror to onreadingerror

This change renames NDEFReader.prototype.onerror to
NDEFReader.prototype.onreadingerror, per the spec change at
w3c/web-nfc@a71bff9
(w3c/web-nfc#601).

* Re-sort NDEFReader subfeatures to make linter glad
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this pull request Dec 10, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094
sidvishnoi pushed a commit to sidvishnoi/gecko-webmonetization that referenced this pull request Dec 10, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 14, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <harakenchromium.org>
Reviewed-by: Reilly Grant <reillygchromium.org>
Reviewed-by: François Beaufort <beaufort.francoisgmail.com>
Commit-Queue: François Beaufort <beaufort.francoisgmail.com>
Cr-Commit-Position: refs/heads/master{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094

UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 14, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <harakenchromium.org>
Reviewed-by: Reilly Grant <reillygchromium.org>
Reviewed-by: François Beaufort <beaufort.francoisgmail.com>
Commit-Queue: François Beaufort <beaufort.francoisgmail.com>
Cr-Commit-Position: refs/heads/master{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094

UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 14, 2020
… a=testonly

Automatic update from web-platform-tests
web-nfc: Merge NDEFWriter in NDEFReader

NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <harakenchromium.org>
Reviewed-by: Reilly Grant <reillygchromium.org>
Reviewed-by: François Beaufort <beaufort.francoisgmail.com>
Commit-Queue: François Beaufort <beaufort.francoisgmail.com>
Cr-Commit-Position: refs/heads/master{#832236}

--

wpt-commits: 77f3f1533681dedef98a4c94c2abdb562d097002
wpt-pr: 26094

UltraBlame original commit: ecf56f63bb2558df400ac93be88c868c81595f25
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
The NDEFReader onerror event handler is renamed to onreadingerror to
make it clear to web developers that only NFC read errors will be fired
in this event as NDEFReader and NDEFWriter will soon been merged. Note
that an error message is now displayed in the devtools JS console to
help web developers to diagnose issues while it was part of the error
event before.

This CL also removes onreadingerror event fired on MojoConnectionError
as this is called if either the NFC service is unavailable in which case
NDEFReader.scan() will return a rejected promise, or when NFC permission
is revoked in which case the Permission API can be used to detect
changes.

Spec: w3c/web-nfc#601
Bug: 520391
Change-Id: I451083fb5382149e9a1e45da31e575709f190448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546011
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#829626}
GitOrigin-RevId: 5d80d77e62168984affeee6ac9e335a788a997df
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
NDEFWriter and NDEFReader share a lot of similar
features and a writing device, will also read.

Therefore it was decided to simplify NDEF functionality,
and to have only one class called NDEFReader,
which can read and write.

refers to w3c/web-nfc#601

Because kWebNfcNdefReaderScan and kWebNfcNdefWriterWrite are now
used in idl extended attributes, their usages
may be higher now as they were fired after user granted permission.

Bug: 1131141
Change-Id: I8cc2ce053e5bb43c0fa5b299bdaf5cb5317bf859
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424208
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: François Beaufort <beaufort.francois@gmail.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Cr-Commit-Position: refs/heads/master@{#832236}
GitOrigin-RevId: c86f47d0879af24702bbfb7ba5410432c7ce3fe1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants