HTMLCanvasElement.toDataURL - 函数命名不正确?

HTMLCanvasElement.toDataURL - Incorrectly named function?

根据我目前的理解,声明数据 URI 实际上是 URL。

是不正确的

因此,考虑到这一点,我说 JavaScript 函数 HTMLCanvasElement.getDataURL() 的命名不正确是否正确?或者有什么特定的原因来命名它。

我指的是 this answer,因为它指出数据 URI 不是 URL。

URI 和 URL 的当代定义可能被认为是不准确的,但根据 W3 recommendation the naming is based on RFC 2397,它定义了数据 URL计划。

WHATWG 决定希望

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 浏览器现在有一个内置的标准化 URL 对象,用于创建 Blob URLs。告别 URI。