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

Remove the origin aliasing concept #868

Merged
merged 1 commit into from Mar 22, 2016
Merged

Remove the origin aliasing concept #868

merged 1 commit into from Mar 22, 2016

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 14, 2016

Turns out effective script origins are shared, not aliased.

Fixes #794.

annevk added a commit that referenced this pull request 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 15, 2016

@jeisinger would you be willing to review this?

@jeisinger
Copy link
Member

yup, will have a closer look at this tomorrow

<code>Document</code></span>.</p></li>
<li>
<p>If the new <span>browsing context</span> has a <span>creator browsing context</span>,
then the <span>origin</span> of <var>document</var> is a copy of the <span>origin</span> of
Copy link
Member

Choose a reason for hiding this comment

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

why did you replace this with copy instead of sharing the origin with the creator browsing context?

Copy link
Member Author

Choose a reason for hiding this comment

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

It felt cleaner since origin (as opposed to effective script origin) can never change, but I guess it doesn't matter much.

@annevk
Copy link
Member Author

annevk commented Mar 21, 2016

@domenic can you do follow up review here? (Jochen is otherwise occupied.) Note that per https://www.w3.org/Bugs/Public/show_bug.cgi?id=27378 I'm planning follow up fixes that will merge effective script origin into origin, to more closely match implementations and improve the readability of the specification (as well as the overall model).

@domenic
Copy link
Member

domenic commented Mar 22, 2016

This looks good to me. I agree that copy vs. share is confusing. My preferred model would probably be that origin tuples are immutable and that document.domain reassigns the relevant documents' origins to a newly-created tuple. Then you can share with no fear. But based on #794 it sounds like that is not how implementations work. So your strategy of doing copies everywhere except where it's supposed to be explicitly shared seems like the best we can get.

@domenic domenic merged commit 438155d into master Mar 22, 2016
Turns out effective script origins are shared, not aliased.

Fixes #794.
@domenic domenic deleted the remove-origin-alias branch March 22, 2016 18:13
annevk added a commit that referenced this pull request Mar 22, 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. 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 added a commit that referenced this pull request Mar 22, 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. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants