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

Editorial: simplify same-site definitions #5955

Closed
wants to merge 1 commit into from
Closed

Conversation

domenic
Copy link
Member

@domenic domenic commented Sep 28, 2020

This makes it more clear that (schemelessly) same-site are connected to
the site concept.

There's a few editorial things I'm not sure about which I will comment on as a review.


/origin.html ( diff )

This makes it more clear that (schemelessly) same-site are connected to
the site concept.
</ol>
</li>
<li><p>If <var>siteA</var>'s <span data-x="concept-host">host</span> equals
<var>siteB</var>'s <span data-x="concept-host">host</span>, then return true.</p></li>
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't have dedicated definitions for each component of the scheme-and-host tuple, so I linked to the generic definition of host. Should we instead create such explicit fields?

<li><p>Let <var>siteB</var> be the result of <span data-x="obtain a site">obtaining a site</span>
given <var>B</var>.</p></li>

<li><p>If <var>siteA</var> equals <var>siteB</var>, then return true.</p></li>
Copy link
Member Author

Choose a reason for hiding this comment

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

This relies on a somewhat-sophisticated, but intuitive, notion of "equals". In particular, it assumes that:

  • An opaque origin is never equal to a tuple
  • Equals is "polymorphic": if given two opaque origins, it will use identity; if given two tuples, it will use tuple-equality.
  • Tuple equality is defined as being pairwise. (Probably Infra should be updated to state this explicitly.)
  • Very similar considerations for when comparing siteA[1] and siteB[1], i.e. comparing two hosts:
    • An IP address is never equal to a string
    • If given two IP addresses, it will use number-equality; if given two strings, it will use string-equality.

I think we should update Infra to discuss tuple equality, but I'm a bit resistant to make this more explicit, e.g. by branching on types. It would feel pretty redundant. Thoughts welcome.

return true.</p></li>
</ol>
</li>
<li><p>If <var>siteA</var>'s <span data-x="concept-host">host</span> equals
Copy link
Member

Choose a reason for hiding this comment

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

This should reference "host equals", right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I was looking for that for a while, but couldn't find it... it's all the way down in "Host miscellaneous". https://url.spec.whatwg.org/#concept-host-equals. I guess the value-add is that people might read the red box?

<li><p>Let <var>siteB</var> be the result of <span data-x="obtain a site">obtaining a site</span>
given <var>B</var>.</p></li>

<li><p>If <var>siteA</var> equals <var>siteB</var>, then return true.</p></li>
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we can leave equals undefined here.

@domenic
Copy link
Member Author

domenic commented Jan 8, 2021

I guess I'll close this as defining "equals" makes this more complex than the original version it was trying to simplify.

@domenic domenic closed this Jan 8, 2021
@annevk annevk deleted the simpler-same-site branch January 8, 2021 16:59
@domenic domenic mentioned this pull request Jun 6, 2022
3 tasks
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.

2 participants