1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 12:17:35 +00:00

LibWebView+Ladybird: Move DOM inspection helpers to ViewImplementation

This commit is contained in:
Linus Groh 2023-01-12 20:22:14 +00:00 committed by Andreas Kling
parent f313708237
commit 2428e3e675
9 changed files with 56 additions and 96 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2023, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -7,6 +8,7 @@
#pragma once
#include <AK/Forward.h>
#include <AK/String.h>
#include <LibGfx/Forward.h>
#include <LibGfx/StandardCursor.h>
#include <LibWeb/Forward.h>
@ -19,11 +21,25 @@ class ViewImplementation {
public:
virtual ~ViewImplementation() { }
struct DOMNodeProperties {
String computed_style_json;
String resolved_style_json;
String custom_properties_json;
String node_box_sizing_json;
};
void zoom_in();
void zoom_out();
void reset_zoom();
void get_source();
void inspect_dom_tree();
void inspect_accessibility_tree();
ErrorOr<DOMNodeProperties> inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> pseudo_element);
void clear_inspected_dom_node();
i32 get_hovered_node_id();
virtual void notify_server_did_layout(Badge<WebContentClient>, Gfx::IntSize content_size) = 0;
virtual void notify_server_did_paint(Badge<WebContentClient>, i32 bitmap_id) = 0;
virtual void notify_server_did_invalidate_content_rect(Badge<WebContentClient>, Gfx::IntRect const&) = 0;