1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:22:07 +00:00

LibWeb: Make factory method of DOM::ElementFactory fallible

This commit is contained in:
Kenneth Myhra 2023-02-19 16:22:24 +01:00 committed by Andreas Kling
parent a2381a672d
commit ff92324fa5
15 changed files with 115 additions and 111 deletions

View file

@ -57,7 +57,7 @@ Response capture_element_screenshot(Painter const& painter, Page& page, DOM::Ele
auto viewport_rect = page.top_level_browsing_context().viewport_rect();
rect.intersect(page.enclosing_device_rect(viewport_rect).to_type<int>());
auto canvas_element = DOM::create_element(element.document(), HTML::TagNames::canvas, Namespace::HTML);
auto canvas_element = DOM::create_element(element.document(), HTML::TagNames::canvas, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
auto& canvas = verify_cast<HTML::HTMLCanvasElement>(*canvas_element);
if (!canvas.create_bitmap(rect.width(), rect.height())) {