|
@@ -375,13 +375,13 @@ void CanvasRenderingContext2D::fill(Path2D& path, StringView fill_rule)
|
|
|
return fill_internal(transformed_path, parse_fill_rule(fill_rule));
|
|
|
}
|
|
|
|
|
|
-WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> CanvasRenderingContext2D::create_image_data(int width, int height) const
|
|
|
+WebIDL::ExceptionOr<JS::NonnullGCPtr<ImageData>> CanvasRenderingContext2D::create_image_data(int width, int height, Optional<ImageDataSettings> const& settings) const
|
|
|
{
|
|
|
- return ImageData::create(realm(), width, height);
|
|
|
+ return ImageData::create(realm(), width, height, settings);
|
|
|
}
|
|
|
|
|
|
// https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-getimagedata
|
|
|
-WebIDL::ExceptionOr<JS::GCPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int x, int y, int width, int height) const
|
|
|
+WebIDL::ExceptionOr<JS::GCPtr<ImageData>> CanvasRenderingContext2D::get_image_data(int x, int y, int width, int height, Optional<ImageDataSettings> const& settings) const
|
|
|
{
|
|
|
// 1. If either the sw or sh arguments are zero, then throw an "IndexSizeError" DOMException.
|
|
|
if (width == 0 || height == 0)
|
|
@@ -393,7 +393,7 @@ WebIDL::ExceptionOr<JS::GCPtr<ImageData>> CanvasRenderingContext2D::get_image_da
|
|
|
|
|
|
// 3. Let imageData be a new ImageData object.
|
|
|
// 4. Initialize imageData given sw, sh, settings set to settings, and defaultColorSpace set to this's color space.
|
|
|
- auto image_data = TRY(ImageData::create(realm(), width, height));
|
|
|
+ auto image_data = TRY(ImageData::create(realm(), width, height, settings));
|
|
|
|
|
|
// NOTE: We don't attempt to create the underlying bitmap here; if it doesn't exist, it's like copying only transparent black pixels (which is a no-op).
|
|
|
if (!canvas_element().bitmap())
|