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
Conversation
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nit
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See example comments
…ple. Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
…ypes Signed-off-by: Zoltan Kis <zoltan.kis@intel.com>
In the last commit, a few changes were necessary.
Then the "create NDEF record" steps were factored out to make it more modular. |
…|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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web lowercase
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meant - intented
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/records/record/ ?
There was a problem hiding this comment.
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 :).
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if there's a difference to be honest.
FYI https://github.com/search?q=org%3AWICG+%22terminate+these+steps%22&type=Code vs https://github.com/search?q=org%3AWICG+%22abort+these+steps%22&type=Code
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it doesn't.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM
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? |
+1 to @leonhsl's comment |
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. |
Some commits are worth squashing, some others aren't. So now should I make a PR for modifying upstream history? |
github should notify you about new commits made on PR's where you commented. |
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. |
Signed-off-by: Zoltan Kis zoltan.kis@intel.com
Preview | Diff