LibWeb: Add CanvasRenderingContext2D context attribute parsing

Makes `context.getContextAttributes()` work.
This commit is contained in:
Jelle Raaijmakers 2025-04-28 16:01:47 +02:00
commit fac0f82031
Notes: github-actions[bot] 2025-04-29 11:52:34 +00:00
6 changed files with 81 additions and 17 deletions

View file

@ -43,7 +43,7 @@ ErrorOr<GC::Ref<HTML::HTMLCanvasElement>, WebDriver::Error> draw_bounding_box_fr
MUST(canvas.set_height(paint_height));
// FIXME: 5. Let context, a canvas context mode, be the result of invoking the 2D context creation algorithm given canvas as the target.
canvas.create_2d_context();
MUST(canvas.create_2d_context({}));
canvas.allocate_painting_surface_if_needed();
if (!canvas.surface())
return Error::from_code(ErrorCode::UnableToCaptureScreen, "Failed to allocate painting surface"sv);