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

Fix #396: add section for local type record #451

Merged
merged 12 commits into from Dec 11, 2019
Merged

Conversation

zolkis
Copy link
Contributor

@zolkis zolkis commented Nov 26, 2019

Signed-off-by: Zoltan Kis zoltan.kis@intel.com


Preview | Diff

Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
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.

LGTM with nit

index.html Outdated Show resolved Hide resolved
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
index.html Outdated Show resolved Hide resolved
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
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.

See example comments

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
index.html Outdated Show resolved Hide resolved
…ple.

Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@zolkis
Copy link
Contributor Author

zolkis commented Dec 6, 2019

In the last commit, a few changes were necessary.
Since the checks added for local and external types and they could not be added to the "switch on recordType" step, the create algorithm was modified:

  • id was moved in front, so that the switch could return the "map ... to NDEF" steps
  • the "map ... to NDEF" steps received another parameter, |ndef|
  • check for external type added
  • check for local type added

Then the "create NDEF record" steps were factored out to make it more modular.
Some white-space moving was done so that the "map ... to NDEF" algorithms are subsections to "create NDEF message".

…|ndef| parameter

Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
index.html Outdated
<section><h4>Well-known local types</h4>
<p>
NFC Forum <dfn>local type</dfn> that are defined by the NFC Forum or
by an application, and always start with lowercase letter or a
Copy link
Contributor

Choose a reason for hiding this comment

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

letter > character?

index.html Outdated
by an application, and always start with lowercase letter or a
number. Those are usually short strings that are unique only within
the local context of the containing record. They are used when types
meaning doesn't matter outside of the local context of the
Copy link
Contributor

Choose a reason for hiding this comment

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

when teh meaning of types doesn't matter

index.html Outdated
</p>
<div>
<dfn>Smart poster</dfn> is defined in [[NDEF-SMARTPOSTER]] to describe a
given Web content as an NDEF record that contains an <a>NDEF message</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

web lowercase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it should be Web content, since webcontent is not a thing.
https://grammarist.com/spelling/web-site-website/

Copy link
Collaborator

Choose a reason for hiding this comment

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

We use "Web" only for "Web NFC". We use "web" for "web page" and "web site" in the spec

index.html Outdated
<a>action record</a> is missing.
<p class="note">
At the time of NDEF standardization the value `0` ("do the action") was
meant for use cases like send an SMS, make a call or launch browser.
Copy link
Contributor

Choose a reason for hiding this comment

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

meant - intented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also corrected elsewhere.

index.html Outdated
When the domain name is not provided, by default Web NFC uses the
<a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain">
effective domain of the origin</a> as domain name in external type
names when <a href="#mapping-external-data-to-ndef">creating external type records</a>. Therefore, applications MAY specify only the
Copy link
Contributor

Choose a reason for hiding this comment

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

wrap line

</p>
<p class="note">
The [[NFC-RTD]] mandates that external type names are represented
with the URN prefix “`urn:nfc:ext:`”, e.g. when reading
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe clarify here that that is actually not encoded - so I don;t know how much they "mandate" it. It is more considered an URL with that prefix though that is not even encoded

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the NFC Forum spec it's absolutely normative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why the Note was made, to justify why Web NFC does not comply.

index.html Outdated
<li>
If |input| starts with colon ('`:`'), let |domain:string| be the
<a data-cite="url#concept-url-serializer">serialization</a> of the
<a href="https://html.spec.whatwg.org/multipage/origin.html#concept-origin-effective-domain">effective domain of
Copy link
Contributor

Choose a reason for hiding this comment

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

no easier way to quote? check https://respec.org/xref/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<a data-cite="html">effective domain</a> of the {{Document/origin}}

Thanks!

Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
index.html Outdated
<section><h4>Well-known global types</h4>
<p>
NFC Forum <dfn>global type</dfn>s are defined and managed by the
NFC Forum and usually start with uppercase letter.
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency, shall we use "character" as well there?

index.html Outdated
</p>
<div>
<dfn>Smart poster</dfn> is defined in [[NDEF-SMARTPOSTER]] to describe a
given Web content as an NDEF record that contains an <a>NDEF message</a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We use "Web" only for "Web NFC". We use "web" for "web page" and "web site" in the spec

index.html Outdated
</li>
<li>
Zero or more <a>Text records</a> that act as a <dfn>title record</dfn>
related to the content. When there are more than one title records
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/records/record/ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure about "web content". English grammar seems to prefer "Web content". At least it's disputed. But indeed if we can say "we" use "web content", that's what "we" use I guess :).

Copy link
Contributor

Choose a reason for hiding this comment

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

US English dictionaries changed... it used to be e-mail, now email is preferred and it used to be Web always, but now web is totally fine.

index.html Outdated
<section><h3>Validating external type</h3>
<p>
The [[NFC-RTD]] specifies that external types MUST contain
the domain name of the issuing organization, a a colon and a type
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo: Remove one "a"

domain name in external type names when
<a href="#mapping-external-data-to-ndef">
creating external type records</a>. Therefore, applications MAY specify
only the colon and the external type name.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd love a JS example of this for readers in a follow-up CL. Please track this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The example with "example.com:sp" could be written as ":sp" if the app wanted the Web NFC implementation prefix it with the effective domain name of the document origin. Should that be another example (when the difference is so small)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

A simple comment in the existing example could be enough.

index.html Outdated
<ol class=algorithm id="validate-local-type">
<li>
If |input| is not a {{USVString}} or its length exceeds 255 bytes,
return `false` and terminate these steps.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use "abort" instead of "terminate".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted for the future as well. Is there a difference in terminate vs abort? Abort (for me) means we do clean-up steps as well, possibly rolling back a transaction. Terminate means jumping to the end.

Copy link
Contributor

@kenchris kenchris Dec 9, 2019

Choose a reason for hiding this comment

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

Terminology is not specified that precisely to my knowledge, but abort is what most specs use today

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

We used both in manifest but mostly moved to abort now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, so it's internal terminology (not aligned with terms outside web specs).

index.html Outdated
return `false` and terminate these steps.
</li>
<li>
If |input| does not start with a lowercase letter or a number,
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/letter/character/

To <dfn>map empty record to NDEF</dfn> given a |record:NDEFRecordInit|,
run these steps:
To <dfn>map empty record to NDEF</dfn> given a |record:NDEFRecordInit|
and |ndef|, run these steps:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Algorithm below should not state "Let ndefRecord be the notation for the NDEF record to be created by the UA." anymore if I'm reading this correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, it doesn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it did say "Let |ndef| be ...", right. Thanks for noticing.

Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
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.

Still LGTM

@zolkis zolkis merged commit 80a2cdb into w3c:gh-pages Dec 11, 2019
@leonhsl
Copy link
Contributor

leonhsl commented Dec 11, 2019

I do suggest not to commit 12 commits from one PR, the repo's commit list looks kind of a mess and hard to understand what's going on. Could we squash and commit?
I'm unsure there's some well-accepted rule when working on github though. On Chromium each CL is supposed to complete one task cleary with a helpful commit message.

@beaufortfrancois
Copy link
Collaborator

+1 to @leonhsl's comment
Please squash with a nice commit message.

@leonhsl
Copy link
Contributor

leonhsl commented Dec 11, 2019

Also, I'm confused about why I was not notified to check whether my comments are addressed, seems due to some magical operations (I'm not clear) on multiple commits... Usually, once people started a review they want to follow along the way.

@zolkis
Copy link
Contributor Author

zolkis commented Dec 11, 2019

Some commits are worth squashing, some others aren't.
If there are a lot of changes in a PR, they have to go somewhere. It does not make sense to squash into a single commit that changes half the spec. It won't help any readability.
However, review comment fixes could be squashed.

So now should I make a PR for modifying upstream history?

@zolkis
Copy link
Contributor Author

zolkis commented Dec 11, 2019

I'm confused about why I was not notified to check whether my comments are addressed

github should notify you about new commits made on PR's where you commented.

@leonhsl
Copy link
Contributor

leonhsl commented Dec 11, 2019

I did not receive any updates for this PR until today. I guess the scenario is like, I added some comments on your commit (or a branch in your own repo?), after that you added that commit into this PR as part of it, so strictly speaking I was not commenting on this PR.

At least for me, I do not know how to modify the history commit list.. I'm just suggesting to manage each PR (or commit) clearly to be something logical, it's a general rule I suppose, and the writer has the freedom to do that flexibly.

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