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

Cleanup origin serialization #870

Merged
merged 1 commit into from Mar 22, 2016
Merged

Cleanup origin serialization #870

merged 1 commit into from Mar 22, 2016

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 14, 2016

Origin serialization didn’t properly serialize hosts and ports and
used the domain to Unicode and domain to ASCII algorithms
incorrectly, passing domain labels rather than domains (not
accounting for the fact that the host might not be a domain either).

This depends on #868 landing since it assumes aliasing is no longer a
thing.

This also depends on the URL Standard changing to no longer pass the
default port when computing the origin of a URL. Instead, an origin
and a URL should share the same data model subset, where port can be
null. Since they serialise the same way, that makes things easier to
understand.

This fixes #611,
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28788, and
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29056.

@annevk
Copy link
Member Author

annevk commented Mar 14, 2016

@SimonSapin, you might want to review this.

part of the <span>origin</span> tuple, and append the results &mdash; each component, in the same
order, separated by U+002E FULL STOP characters (.) &mdash; to <var>result</var>. <ref spec=URL></p></li>
<li><p>Let <var>unicodeHost</var> be <var>host</var> if <var>host</var> is not a
<span>domain</span>, and the result of applying <span>domain to Unicode</span> to <var>host</var>
Copy link
Member Author

Choose a reason for hiding this comment

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

data="concept-domain"*

@SimonSapin
Copy link
Contributor

(As a side note, I find it hard to find the one thing that changed when a paragraph is almost entirely red/green in the diff because it was re-wrapped. Please consider http://rhodesmill.org/brandon/2012/one-sentence-per-line/. Maybe not to rewrap everything at once, but for paragraphs that you otherwise edit.)

@SimonSapin
Copy link
Contributor

Looks good to me.

@annevk annevk added the do not merge yet Pull request must not be merged per rationale in comment label Mar 15, 2016
@annevk
Copy link
Member Author

annevk commented Mar 15, 2016

FWIW, I added the do not merge yet label because it needs to land after #868 and I need to fix the nit above.

@@ -78104,7 +78103,7 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span
<dl>


<dt><dfn data-x="concept-origin-opaque-identifiers">Opaque identifiers</dfn></dt>
<dt><dfn data-x="concept-origin-opaque-identifier">Opaque identifiers</dfn></dt>
Copy link
Member

Choose a reason for hiding this comment

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

Why change these and break incoming links?

@domenic
Copy link
Member

domenic commented Mar 22, 2016

LGTM, land at will

Origin serialization didn’t properly serialize hosts and ports and
used the domain to Unicode and  domain to ASCII algorithms
incorrectly, passing domain labels rather than domains (not
accounting for the fact that the host might not be a domain either).

This depends on #868 landing since it assumes aliasing is no longer a
thing.

This also depends on the URL Standard changing to no longer pass the
default port when computing the origin of a URL. Instead, an origin
and a URL should share the same data model subset, where port can be
null. Since they serialise the same way, that makes things easier to
understand. See whatwg/url#102 for that.

This fixes #611,
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28788, and
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29056.
@annevk annevk merged commit 5dcc1ee into master Mar 22, 2016
@annevk annevk deleted the origin-serialization branch March 23, 2016 14:33
domenic added a commit to jsdom/whatwg-url that referenced this pull request Apr 15, 2016
See whatwg/html#870 and whatwg/url@b0e4def. I don't believe this changes any observable output; it is just a simplification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge yet Pull request must not be merged per rationale in comment
Development

Successfully merging this pull request may close these issues.

"ASCII serialisation of an origin" and "domain to ASCII"
3 participants