|
@@ -754,19 +754,7 @@ void ConnectionFromClient::take_document_screenshot(u64 page_id)
|
|
|
if (!page.has_value())
|
|
|
return;
|
|
|
|
|
|
- auto* document = page->page().top_level_browsing_context().active_document();
|
|
|
- if (!document || !document->document_element()) {
|
|
|
- async_did_take_screenshot(page_id, {});
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- auto const& content_size = page->content_size();
|
|
|
- Web::DevicePixelRect rect { { 0, 0 }, content_size };
|
|
|
-
|
|
|
- auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, rect.size().to_type<int>()).release_value_but_fixme_should_propagate_errors();
|
|
|
- page->paint(rect, *bitmap);
|
|
|
-
|
|
|
- async_did_take_screenshot(page_id, bitmap->to_shareable_bitmap());
|
|
|
+ page->queue_screenshot_task({});
|
|
|
}
|
|
|
|
|
|
void ConnectionFromClient::take_dom_node_screenshot(u64 page_id, i32 node_id)
|
|
@@ -775,18 +763,7 @@ void ConnectionFromClient::take_dom_node_screenshot(u64 page_id, i32 node_id)
|
|
|
if (!page.has_value())
|
|
|
return;
|
|
|
|
|
|
- auto* dom_node = Web::DOM::Node::from_unique_id(node_id);
|
|
|
- if (!dom_node || !dom_node->paintable_box()) {
|
|
|
- async_did_take_screenshot(page_id, {});
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- auto rect = page->page().enclosing_device_rect(dom_node->paintable_box()->absolute_border_box_rect());
|
|
|
-
|
|
|
- auto bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRA8888, rect.size().to_type<int>()).release_value_but_fixme_should_propagate_errors();
|
|
|
- page->paint(rect, *bitmap, { .paint_overlay = Web::PaintOptions::PaintOverlay::No });
|
|
|
-
|
|
|
- async_did_take_screenshot(page_id, bitmap->to_shareable_bitmap());
|
|
|
+ page->queue_screenshot_task(node_id);
|
|
|
}
|
|
|
|
|
|
Messages::WebContentServer::DumpGcGraphResponse ConnectionFromClient::dump_gc_graph(u64)
|