toDataURL and toBlob should not throw for serialization errors
Categories
(Core :: Graphics: Canvas2D, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: tristan.fraipont, Assigned: baku)
Details
(Keywords: reproducible)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
create a huge <canvas> (50K * 50K pixels)
call toDataURL or toBlob
Actual results:
The toDataURL call throws an error NS_ERROR_ILLEGAL_VALUE
The toBlob one fails silently.
Expected results:
toDataURL should have returned the string "data:,"
,
toBlob should have invoked the callback with null
as result.
Here are the specs for the serialization of the bitmap as file[1], where it said
If an error occurs during the creation of the image file (e.g. an internal encoder error), then the result of the serialization is null.
Note that as far as I could check, Firefox always had this behavior, though it's been fixed for zero sized canvas: https://bugzilla.mozilla.org/show_bug.cgi?id=649618
[1][https://html.spec.whatwg.org/multipage/canvas.html#a-serialisation-of-the-bitmap-as-a-file]
Updated•5 years ago
|
Comment 1•5 years ago
|
||
It looks like Morris Tseng is no longer with us. Andrea, do you know who would be the appropriate maintainer for this code?
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Pushed by amarchesini@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30509dab7f70 canvas toDataURL and toBlob should not throw for serialization errors, r=jya
Comment 4•5 years ago
|
||
bugherder |
Description
•