1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:37:34 +00:00

LibWeb+WebContent+WebWorker: Add an option to skip painting the overlay

This will allow the Inspector to take a screenshot of a DOM node without
the overlay which renders the inspected node outline / box data.
This commit is contained in:
Timothy Flynn 2023-12-06 11:49:45 -05:00 committed by Andreas Kling
parent bea11f6d99
commit a7b98a9761
8 changed files with 26 additions and 8 deletions

View file

@ -198,6 +198,15 @@ private:
bool m_pdf_viewer_supported { false };
};
struct PaintOptions {
enum class PaintOverlay {
No,
Yes,
};
PaintOverlay paint_overlay { PaintOverlay::Yes };
};
class PageClient : public JS::Cell {
JS_CELL(PageClient, JS::Cell);
@ -209,7 +218,7 @@ public:
virtual DevicePixelRect screen_rect() const = 0;
virtual double device_pixels_per_css_pixel() const = 0;
virtual CSS::PreferredColorScheme preferred_color_scheme() const = 0;
virtual void paint(DevicePixelRect const&, Gfx::Bitmap&) = 0;
virtual void paint(DevicePixelRect const&, Gfx::Bitmap&, PaintOptions = {}) = 0;
virtual void page_did_change_title(DeprecatedString const&) { }
virtual void page_did_request_navigate_back() { }
virtual void page_did_request_navigate_forward() { }