Skip to content

Truly independent web browser

LibWeb: Fix two typos in the error messages of ImageData

Andreas Kling46972584488f
diff --git a/Libraries/LibWeb/Bindings/Rust/src/html/image_data.rs b/Libraries/LibWeb/Bindings/Rust/src/html/image_data.rs
index 641687dc4ae..5eea650c3d1 100644
--- a/Libraries/LibWeb/Bindings/Rust/src/html/image_data.rs
+++ b/Libraries/LibWeb/Bindings/Rust/src/html/image_data.rs
@@ -111,7 +111,7 @@ impl ImageData {
// 2. If length is not a nonzero integral multiple of four, then throw an "InvalidStateError" DOMException.
if length == 0 || !length.is_multiple_of(BYTES_PER_PIXEL) {
return Err(invalid_state_error(
- b"Source data must have a non-sero length that is a multiple of four.",
+ b"Source data must have a non-zero length that is a multiple of four.",
));
}
@@ -172,7 +172,7 @@ impl ImageData {
.and_then(|pixels| pixels.checked_mul(BYTES_PER_PIXEL))
else {
return Err(Exception::index_size_error(Utf16String::from_ascii(
- b"The specified image size could not created",
+ b"The specified image size could not be created",
)));
};
diff --git a/Tests/LibWeb/Text/expected/canvas/2d-image-data-arguments.txt b/Tests/LibWeb/Text/expected/canvas/2d-image-data-arguments.txt
index ecf5909f48d..58c51335997 100644
--- a/Tests/LibWeb/Text/expected/canvas/2d-image-data-arguments.txt
+++ b/Tests/LibWeb/Text/expected/canvas/2d-image-data-arguments.txt
@@ -21,7 +21,7 @@ createImageData(0, 1): DOMException IndexSizeError: Width and height must not be
createImageData(1, NaN): TypeError: Number must not be NaN or Infinity
createImageData(2 ** 31, 1): TypeError: Number '2147483648' is outside of allowed range of -2147483648 to 2147483647
createImageData(1.99, -1.99): ImageData 1x1 [0,0,0,0]
-createImageData(-(2 ** 31), 1): DOMException IndexSizeError: The specified image size could not created
+createImageData(-(2 ** 31), 1): DOMException IndexSizeError: The specified image size could not be created
createImageData(new ImageData(3, 1)): ImageData 3x1 [0,0,0,0,0,0,0,0,0,0,0,0]
createImageData(1, 1, { colorSpace: "srgb-linear" }).colorSpace: srgb-linear
createImageData(null): TypeError: Not an object of type ImageData
@@ -72,7 +72,7 @@ createImageData(0, 1): DOMException IndexSizeError: Width and height must not be
createImageData(1, NaN): TypeError: Number must not be NaN or Infinity
createImageData(2 ** 31, 1): TypeError: Number '2147483648' is outside of allowed range of -2147483648 to 2147483647
createImageData(1.99, -1.99): ImageData 1x1 [0,0,0,0]
-createImageData(-(2 ** 31), 1): DOMException IndexSizeError: The specified image size could not created
+createImageData(-(2 ** 31), 1): DOMException IndexSizeError: The specified image size could not be created
createImageData(new ImageData(3, 1)): ImageData 3x1 [0,0,0,0,0,0,0,0,0,0,0,0]
createImageData(1, 1, { colorSpace: "srgb-linear" }).colorSpace: srgb-linear
createImageData(null): TypeError: Not an object of type ImageData