-
Notifications
You must be signed in to change notification settings - Fork 141
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
Use empty host for file URL's #260
Changes from 5 commits
ff5ab18
ac38a3a
98ec637
f91dc1b
03d2424
4335e76
eb71fd1
19f5a62
3893222
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,9 +254,9 @@ point <a for=/>URLs</a> from <var>A</var> can come from untrusted sources. | |
<h3 id=host-representation>Host representation</h3> | ||
|
||
<p>A <dfn export id=concept-host>host</dfn> is a <a>domain</a>, an | ||
<a>IPv4 address</a>, an <a>IPv6 address</a>, or an <a>opaque host</a>. Typically a <a for=/>host</a> | ||
serves as a network address, but it is sometimes used as opaque identifier in <a for=/>URLs</a> | ||
where a network address is not necessary. | ||
<a>IPv4 address</a>, an <a>IPv6 address</a>, an <a>opaque host</a>, or an <a>empty host</a>. | ||
Typically a <a for=/>host</a> serves as a network address, but it is sometimes used as opaque | ||
identifier in <a for=/>URLs</a> where a network address is not necessary. | ||
|
||
<p class=note>The RFCs referenced in the paragraphs below are for informative purposes only. They | ||
have no influence on <a for=/>host</a> writing, parsing, and serialization. Unless stated otherwise | ||
|
@@ -280,12 +280,14 @@ eight <dfn id=concept-ipv6-piece lt='IPv6 piece'>16-bit pieces</dfn>. | |
<p class="note">Support for <code><zone_id></code> is | ||
<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234#c2">intentionally omitted</a>. | ||
|
||
<p>An <dfn export>opaque host</dfn> is an <a>ASCII string</a> holding data that can be used for | ||
further processing. | ||
<p>An <dfn export>opaque host</dfn> is a non-empty <a>ASCII string</a> holding data that can be used | ||
for further processing. | ||
|
||
<p class="note no-backref">An <a>opaque host</a> is only used by <a lt="is special">non-special</a> | ||
<a for=/>URLs</a>. | ||
|
||
<p>An <dfn export>empty host</dfn> is the empty string. | ||
|
||
|
||
<h3 id=host-miscellaneous>Host miscellaneous</h3> | ||
|
||
|
@@ -383,7 +385,7 @@ up to three <a>ASCII digits</a> per sequence, each representing a decimal number | |
|
||
XXX should we define the format inline instead just like STD 66? --> | ||
|
||
<p>An <dfn export>valid opaque-host string</dfn> must be zero or more <a>URL units</a> or: | ||
<p>An <dfn export>valid opaque-host string</dfn> must be one or more <a>URL units</a> or: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you change "An" to "A" here while we're changing this? I can also do it before merging. |
||
"<code>[</code>", followed by a <a>valid IPv6-address string</a>, followed by "<code>]</code>". | ||
|
||
<p class="note no-backref">This is not part of the definition of <a>valid host string</a> as it | ||
|
@@ -768,7 +770,8 @@ no purpose other than being a location the algorithm can jump to. | |
<a>IPv6 serializer</a> on <var>host</var>, | ||
followed by "<code>]</code>". | ||
|
||
<li><p>Otherwise, <var>host</var> is a <a>domain</a> or <a>opaque host</a>, return <var>host</var>. | ||
<li><p>Otherwise, <var>host</var> is a <a>domain</a>, an <a>opaque host</a>, or an <a>empty | ||
host</a>, return <var>host</var>. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it reads more naturally if you leave out the "an". So "A domain, opaque host, or empty host". |
||
</ol> | ||
|
||
The <dfn id=concept-ipv4-serializer>IPv4 serializer</dfn> takes an | ||
|
@@ -1172,9 +1175,10 @@ switching on <a>base URL</a>'s <a for=url>scheme</a>: | |
<dd><p>a <a>path-relative-scheme-less-URL string</a> | ||
<dt>"<code>file</code>" | ||
<dd><p>a <a>scheme-relative-file-URL string</a> | ||
<dd><p>a <a>path-absolute-URL string</a> if <a>base URL</a>'s <a for=url>host</a> is null | ||
<dd><p>a <a>path-absolute-URL string</a> if <a>base URL</a>'s <a for=url>host</a> is an <a>empty | ||
host</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No newlines inside phrasing/inline elements. |
||
<dd><p>a <a>path-absolute-non-Windows-file-URL string</a> if <a>base URL</a>'s <a for=url>host</a> | ||
is non-null | ||
is not an <a>empty host</a> | ||
<dd><p>a <a>path-relative-scheme-less-URL string</a> | ||
<dt>Otherwise | ||
<dd><p>a <a>scheme-relative-URL string</a> | ||
|
@@ -1198,8 +1202,8 @@ optionally followed by a <a>path-absolute-URL string</a>. | |
"<code>//</code>", followed by an <a>opaque-host-and-port string</a>, optionally followed by a | ||
<a>path-absolute-URL string</a>. | ||
|
||
<p>An <dfn export>opaque-host-and-port string</dfn> must be either an empty | ||
<a>valid opaque-host string</a> or: a non-empty <a>valid opaque-host string</a>, optionally followed | ||
<p>An <dfn export>opaque-host-and-port string</dfn> must be either the empty | ||
string or: a <a>valid opaque-host string</a>, optionally followed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's "the empty string" (and an empty host). |
||
by "<code>:</code>" and a <a>URL-port string</a>. | ||
|
||
<p>A <dfn export oldids=syntax-url-file-scheme-relative>scheme-relative-file-URL string</dfn> must be | ||
|
@@ -2066,10 +2070,10 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti | |
<a>Windows drive letter</a>, then: | ||
|
||
<ol> | ||
<li><p>If <var>url</var>'s <a for=url>host</a> is non-null, | ||
<li><p>If <var>url</var>'s <a for=url>host</a> is not the empty string, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here again we're talking about a URL record so we should say "not an empty host". Same below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both an empty host and an opaque host are strings by definition. So maybe it's fine to set host to the empty string in the parser? For example the opaque host parser returns string, but not an opaque host record. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair, I guess some level of implicit casting is probably okay. |
||
<a>validation error</a>. | ||
|
||
<li><p>Set <var>url</var>'s <a for=url>host</a> to null and replace the second | ||
<li><p>Set <var>url</var>'s <a for=url>host</a> to the empty string and replace the second | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is >100 columns. "second" needs to go to the next line. |
||
code point in <var>buffer</var> with "<code>:</code>". | ||
</ol> | ||
|
||
|
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 think either we should have a note like this for empty hosts too or we should drop this one, no?