mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 08:28:11 +00:00
LibWeb: Port HTMLCanvasElement interface from DeprecatedString to String
This commit is contained in:
parent
7206f1777a
commit
76af9d434c
4 changed files with 13 additions and 13 deletions
|
@ -36,11 +36,11 @@ static Response encode_canvas_element(HTML::HTMLCanvasElement const& canvas)
|
|||
auto data_url = canvas.to_data_url("image/png"sv, {});
|
||||
|
||||
// 5. Let index be the index of "," in data url.
|
||||
auto index = data_url.find(',');
|
||||
auto index = data_url.find_byte_offset(',');
|
||||
VERIFY(index.has_value());
|
||||
|
||||
// 6. Let encoded string be a substring of data url using (index + 1) as the start argument.
|
||||
auto encoded_string = data_url.substring(*index + 1);
|
||||
auto encoded_string = MUST(data_url.substring_from_byte_offset(*index + 1));
|
||||
|
||||
// 7. Return success with data encoded string.
|
||||
return JsonValue { move(encoded_string) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue