mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibWeb: Fix Canvas.toDataURL and Canvas.toBlob signatures
Fix the function signatures of Canvas.toDataURL() and Canvas.toBlob() and make both functions accept non-numbers as the quality parameter, in which case it will just use the default quality instead of raising an exception. This makes toDataURL.arguments.1.html, toDataURL.arguments.2.html and toDataURL.jpeg.quality.notnumber.html in wpt/html/semantics/embedded-content/the-canvas-element pass :^)
This commit is contained in:
parent
d842d04be4
commit
a6e9f107eb
Notes:
github-actions[bot]
2024-11-15 09:47:24 +00:00
Author: https://github.com/justus2510
Commit: a6e9f107eb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2244
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/trflynn89
4 changed files with 11 additions and 12 deletions
|
@ -72,7 +72,7 @@ Response encode_canvas_element(HTML::HTMLCanvasElement& canvas)
|
|||
|
||||
// 3. Let file be a serialization of the canvas element’s bitmap as a file, using "image/png" as an argument.
|
||||
// 4. Let data url be a data: URL representing file. [RFC2397]
|
||||
auto data_url = canvas.to_data_url("image/png"sv, {});
|
||||
auto data_url = canvas.to_data_url("image/png"sv, JS::js_undefined());
|
||||
|
||||
// 5. Let index be the index of "," in data url.
|
||||
auto index = data_url.find_byte_offset(',');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue