Re: [web-nfc] NFCReadingEvent has an attribute with a type of dictionary? (#232)

Why do we need to have the `NDEFMessageSource` union?
```IDL
typedef (DOMString or ArrayBuffer or NDEFMessage) NDEFMessageSource;
```
Can we just remove it and use NDEFMessage instead as the parameter to NFCWriter#push()?
If users want to push a DOMString or ArrayBuffer, they can just build an NDEFMessage containing a record for the DOMString or ArrayBuffer then feed the NDEFMessage to push(), actually this is just like how our current implementation is internally handling them.

This makes the IDL simpler and easier for users to understand. The current NDEFMessageSource makes people wonder why only DOMString and ArrayBuffer can be fed to push(), but why other objects cannot? like Dictionary etc.

By the way, the current description in the spec http://w3c.github.io/web-nfc/#dom-nfcwriter-push lacks an explanation of how to handle the NDEFMessageSource when it's DOMString or ArrayBuffer.

-- 
GitHub Notification of comment by leonhsl
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/232#issuecomment-510379806 using your GitHub account

Received on Thursday, 11 July 2019 08:11:27 UTC