-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Give <canvas>'s toDataURL() and toBlob() default parameter values #3430
Comments
I changed the IDL, but I'm not sure which parts of the spec need to be updated. Can you give me some hints? |
E.g., in step 3 of #dom-canvas-todataurl it says "if they were given", but now we've supplied defaults they will always be given so that can be stricken. The same goes for the a serialization of the bitmap as a file "algorithm" (more like a block of text in its current form). The arguments will always be passed so don't need to be marked optional and there's no need to talk about a default value there either (in the final paragraph before the note). Does that help? |
Thanks, that helped a lot! Edit: I assume that I do the same for |
@gloverdonovan Yup! We could replace "with type and quality if they were given" with "with type and quality" after the IDL change. |
In IDL we can change type and quality to default to "
image/png
" and 1.0 respectively. E.g.,This would then allow a slight simplification of their algorithms as the arguments are now always given. "a serialization of the bitmap as a file" can similarly take advantage as all callers will always provide these arguments now (and we no longer leave the default implementation-defined, as is already the case for
OffscreenCanvas
).The text was updated successfully, but these errors were encountered: