0

It is, under my current understanding, incorrect to declare that a data URI is, in fact, a URL.

So, with that under consideration, would I be correct in saying that the JavaScript function HTMLCanvasElement.getDataURL() has been named incorrectly? Or is there a specific reason for why it was named the way it was.

I refer to this answer, since it states that a data URI is not a URL.

Community
  • 1
  • 1
thephpdev
  • 1,061
  • 9
  • 23
  • The answer is in the question you link to. Why do you ask again? – Touffy Oct 13 '15 at 12:53
  • The reason I asked is because I was amazed that a silly mistake like the difference between URL and URI got through the spec approval process in the first place, and I wanted to know if there was a specific reason for why it might be named in that way. I shall, reword the question, as it is not entirely clear as to what I'm asking for. – thephpdev Oct 13 '15 at 12:58

2 Answers2

2

It might be considered inaccurate by contemporary definitions of URI and URL, but according to the W3 recommendation the naming is based on RFC 2397, which defines the data URL scheme.

Drew Gaynor
  • 7,733
  • 5
  • 36
  • 50
  • I see now, thank you. It seems as though concrete/consistent definitions of URL/URI are nonexistent. – thephpdev Oct 13 '15 at 13:02
  • That RFC is from 1998. However, the "incorrect" use of URL in the sense of URI has been preserved in the far more modern [URL spec](https://url.spec.whatwg.org/#local-scheme). – Touffy Oct 13 '15 at 13:24
  • @Touffy Thanks for the link. I specifically mentioned 2397 as it is referenced in the spec that defines the behavior of the method in question. – Drew Gaynor Oct 13 '15 at 13:27
  • Yeah actually I re-read the URL spec and found a better answer there, straight from the mouth of the WG (see my post) – Touffy Oct 13 '15 at 13:29
1

The WHATWG has decided that it is desirable to

Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the search result popularity contest.

https://url.spec.whatwg.org/#goals

Web browsers now have a built-in, standardized URL object which is used to create Blob URLs. Say goodbye to the URI.

Touffy
  • 5,197
  • 19
  • 26
  • Ah, I see. So the general agenda is to phase distinctions between URL types out? – thephpdev Oct 13 '15 at 13:53
  • Look @thephpdev , if you want a discussion about that, StackOverflow is not the right place. Use the WHATWG mailing list or the spec project on github. – Touffy Oct 13 '15 at 16:35