-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
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> |
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 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> |
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.
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 |
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.
This should reference "host equals", right?
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.
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> |
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 don't think we can leave equals undefined here.
I guess I'll close this as defining "equals" makes this more complex than the original version it was trying to simplify. |
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 )