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

Make definition of "origin" less spread out, and more layered #2761

Closed
domenic opened this issue Jun 14, 2017 · 3 comments · Fixed by #6656
Closed

Make definition of "origin" less spread out, and more layered #2761

domenic opened this issue Jun 14, 2017 · 3 comments · Fixed by #6656
Assignees
Labels
clarification Standard could be clearer topic: origin

Comments

@domenic
Copy link
Member

domenic commented Jun 14, 2017

Spinning off from #2759 (comment)

It's confusing that "origin" as defined right now is seemingly spread out across DOM/HTML/URL/File API. Not to mention the obsoleted "Origin of a URI" spec.

My suggestion would be:

  • Fix Origin of blob URLs doesn't match what implementations do url#127 / "origin of a blob URL" is redundant/confusing w3c/FileAPI#63 so that the File API just defers to the URL Standard instead of overwriting it
  • Move the definition of the origin type, as an opaque origin or tuple origin, into the URL Standard. Ideally the URL Standard should not depend on the HTML Standard for the aspects it deals with. So also move serialization and maybe the same-origin checks.
  • Now we can more clearly start defining "x's origin" in various places: audio/video elements, image elements, Document objects, URL records.
    • Each needs its own distinct <dfn> instead of everyone linking to a central origin definition. This makes it clear they are properties of a (whatever), and their type is origin.
    • Move the definitions into the appropriate sections. This is easy for img/audio/video, where we define the associated concept as an algorithm to return the right value (as opposed to as a mutable internal slot).
    • For Document we should for now move it, without changing it, into the Document section of the HTML spec, as an override to DOM's definition---i.e., overriding DOM's mutable-internal-slot idea with our own algorithm-to-return-the-right-value idea.
    • But over time we should explicitly set its value at various places, instead of saying "if this happened somewhere, then the origin is X". Then we'll be sticking with the mutable-internal-slot version for Document.
    • Related: Reference document's origin accurately #1725

Curious what @annevk thinks.

@domenic domenic added clarification Standard could be clearer topic: origin labels Jun 14, 2017
@bzbarsky
Copy link
Contributor

But over time we should explicitly set its value at various places, instead of saying "if this happened somewhere, then the origin is X".

Yes, please!

@annevk
Copy link
Member

annevk commented Jun 28, 2017

I think this plan is generally sound, but I'm not sure I'd move the core definition from HTML to URL. From what I remember the last time we looked at that it made more sense in HTML or at least it didn't make more sense in URL.

@domenic
Copy link
Member Author

domenic commented Jun 28, 2017

I don't feel strongly on that, but it does feel like at least large parts of the origin concept apply in other environments, e.g. Node.js, where it's a bit weird to implement part of the HTML spec.

domenic added a commit that referenced this issue May 5, 2021
That is, check the type of response directly, instead of synthesizing an opaque origin for opaque responses and then comparing that to the entry settings object's origin.

This helps with #1431 by removing various uses of the entry concept, and closes #2761 by removing the origin concept for image and media elements entirely, since it is now unused.
domenic added a commit that referenced this issue May 6, 2021
That is, check the type of response directly, instead of synthesizing an opaque origin for opaque responses and then comparing that to the entry settings object's origin.

Closes #2813. Helps with #1431 by removing various uses of the entry concept, and closes #2761 by removing the origin concept for image and media elements entirely, since it is now unused.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: origin
Development

Successfully merging a pull request may close this issue.

3 participants