Skip to content

MimeType references to serialization #670

@johntalton

Description

@johntalton

Section 9.15.8 Step 2.

Set record's [mediaType](https://w3c.github.io/web-nfc/#dom-ndefrecord-mediatype) to the result of [serialize a MIME type](https://mimesniff.spec.whatwg.org/#serialize-a-mime-type) with mimeType as the input.

The seems to refer both to a mimeType (assuming that is supposed to be the NDEF typeField as the input) and to the serialization of that data.

Given that we are parsing here, this seems incorrect, regardless. However, MimeType serialization seem to expect a MimeType object (with type and subtype) ... where the NDEF record is just presenting the type field.

In Example 8 the record.mediaType is compared as a string, implying that the NDEF type should must be assigned to mediaType as-is. (because it was already decode into UTF-8 by 9.15.1 step 9).

No need to run MimeType parse either as that would produce a MimeType object.

There are other reference to serialization of MimeType 9.12.8 which could make more sense, assuming the incoming record.mediaType was a MimeType object, however, it seems to be set as a string in most cases (Example 10)

If the intention is to support both USVString|MimeType as the mediaType field of NDEFRecordInit, that is unclear.

apologies if i am reading this wrong 🤷🏻‍♂️, thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions