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
data URLs: revised specification #234
Comments
|
I know. Not really sure what to do. Should URL define it inline? Are you interested in defining it? |
No, just noticed the problem when looking up Fetch-ing |
|
X-Ref: whatwg/url#68 |
|
I think we should define it in Fetch and leave the URL Standard to concern itself with a higher layer (namely the initial parse step). https://simonsapin.github.io/data-urls/ has some good test angles. https://gist.github.com/annevk/4287452653921b2b7de35e4208b4a985 has a basic setup for a web-platform-tests test suite that can be reused by non-browser implementations (especially if we split out the JSON format into its own resource at some point). |
I think I agree with this, but could you say more about the split? |
|
First you run the URL parser over a data URL string to get a URL record. That URL record is the input to the data URL processor (or whatever we call it) which ends up returning a response (this is the algorithm Fetch will invoke from Scheme Fetch and also define someplace). Once we have that we could maybe also consider a |
|
See whatwg/html#2912 for base64 handling. |
This is useful for whatwg/fetch#234 and also simplifies the host parser a bit.
|
Differences between browsers:
|
Unfortunately RFC 2397 has some ambiguities and implementations never really followed it in detail. So here's an attempt to define the processing model more clearly and get implementations aligned. Tests: ... Fixes #234.
I was hoping there'd be some intermediate algorithm that takes a URL record (or perhaps just a path string) and returns you a tuple like (MIME type, byte sequence) (maybe with text encoding too? Or just MIME parameters in general?). This algorithm would then live in the URL Standard. That feels like something that'd be easier to reuse across environments or as part of larger pipelines. And in general just give a good factoring of "data URL processing" separate from fetching. WDYT? |
|
That's more or less what I ended up with (the multiple return values I have now should probably be a tuple), but I'm not sure it should be in the URL Standard. That would also lead credence to the URL Standard having to deal with the mailto: URL scheme and other such things, whereas I don't think it should. |
|
Hmmmmmmm. I think I am convinced by the slippery-slope argument. data: feels special intuitively, but reflecting logically for a while, I think it's not. The process of going from URL -> action and resource is fetching, so I guess it makes sense there. Thanks! |
|
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1392241 as a tracking bug for Firefox. It also contains a summary of the state of this issue and the associated PR. |
This is useful for whatwg/fetch#234, the HTML Standard, and also simplifies the host parser a bit.
Unfortunately RFC 2397 has some ambiguities and implementations never really followed it in detail. So here's an attempt to define the processing model more clearly and get implementations aligned. Tests: ... Fixes #234.
Unfortunately RFC 2397 has some ambiguities and implementations never really followed it in detail. Tests: web-platform-tests/wpt#6890. Fixes #234.
As of SimonSapin/data-urls@82fe8eb , it no longer defines any algorithms.
The text was updated successfully, but these errors were encountered: