mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibWeb: Implement screenshot painting inside Web::WebDriver
This will allow for implementing the screenshot action closer to the spec, as we can now use HTMLCanvasElement to encode the bitmap, and capture the screenshot on the animation frame loop.
This commit is contained in:
parent
6b392cef9c
commit
40b9d248be
Notes:
sideshowbarker
2024-07-17 04:36:29 +09:00
Author: https://github.com/trflynn89
Commit: 40b9d248be
Pull-request: https://github.com/SerenityOS/serenity/pull/16019
Reviewed-by: https://github.com/linusg ✅
3 changed files with 96 additions and 0 deletions
19
Userland/Libraries/LibWeb/WebDriver/Screenshot.h
Normal file
19
Userland/Libraries/LibWeb/WebDriver/Screenshot.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Function.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/WebDriver/Response.h>
|
||||
|
||||
namespace Web::WebDriver {
|
||||
|
||||
using Painter = Function<void(Gfx::IntRect const&, Gfx::Bitmap&)>;
|
||||
Response capture_element_screenshot(Painter const& painter, Page& page, DOM::Element& element, Gfx::IntRect& rect);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue