{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/html/issues/379","labels_url":"https://api.github.com/repos/whatwg/html/issues/379/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/html/issues/379/comments","events_url":"https://api.github.com/repos/whatwg/html/issues/379/events","html_url":"https://github.com/whatwg/html/issues/379","id":120232974,"number":379,"title":"Remove HTMLCanvasElement.prototype.toBlob; replace with promise-returning convertToBlob","user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/whatwg/html/labels/addition/proposal","name":"addition/proposal","color":"d4c5f9"},{"url":"https://api.github.com/repos/whatwg/html/labels/removal/deprecation","name":"removal/deprecation","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-03T18:00:50Z","updated_at":"2015-12-03T19:50:44Z","closed_at":null,"body":"Spinning off from my comments [on blink-dev](https://groups.google.com/a/chromium.org/d/msg/blink-dev/FnZBCN4t46w/sugX6P9wAAAJ) and [in #378](https://github.com/whatwg/html/issues/378#issuecomment-161670982).\r\n\r\nGiven that toBlob(callback) is only implemented in one browser, I think we should remove it and replace it with a promise returning method convertToBlob method.\r\n\r\nAn alternative would be to introduce a promise overload for toBlob, or reuse the same name, but I think this is bad for a number of reasons:\r\n\r\n- Compatibility with Firefox's toBlob(callback) implementation. Any code which wishes to target Firefox, or already does, will have a hard time dealing with the potential divergences here. If we add an overload, then the easiest path for authors will be to just use the callback version, which hurts our chances of removing it in the future.\r\n- toBlob() already is an awkward name when positioned alongside the synchronous toDataURL(). By adding a verb (\"convert\"), we have a signifier that this is going to be an async operation that takes time, and not a synchronous conversion to a different type.\r\n\r\nIt sounds like Blink would be somewhat up for this if Gecko is. [I've asked on blink-dev](https://groups.google.com/a/chromium.org/d/msg/blink-dev/FnZBCN4t46w/9W8U3wd0AAAJ) about the possibilities there."},"comment":{"url":"https://api.github.com/repos/whatwg/html/issues/comments/161762929","html_url":"https://github.com/whatwg/html/issues/379#issuecomment-161762929","issue_url":"https://api.github.com/repos/whatwg/html/issues/379","id":161762929,"user":{"login":"foolip","id":498917,"avatar_url":"https://avatars.githubusercontent.com/u/498917?v=3","gravatar_id":"","url":"https://api.github.com/users/foolip","html_url":"https://github.com/foolip","followers_url":"https://api.github.com/users/foolip/followers","following_url":"https://api.github.com/users/foolip/following{/other_user}","gists_url":"https://api.github.com/users/foolip/gists{/gist_id}","starred_url":"https://api.github.com/users/foolip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foolip/subscriptions","organizations_url":"https://api.github.com/users/foolip/orgs","repos_url":"https://api.github.com/users/foolip/repos","events_url":"https://api.github.com/users/foolip/events{/privacy}","received_events_url":"https://api.github.com/users/foolip/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T19:50:44Z","updated_at":"2015-12-03T19:50:44Z","body":"`getImageData` returns an `ImageData` object, so that would be like `getBlob`, not `getAsBlob`.\r\n\r\nStep 1, however, is to get a Gecko developer on board with changing this. CC @khuey"}}