2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
2022-03-04 19:16:57 +03:00
|
|
|
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
2022-02-10 22:28:48 +03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-01-18 11:38:21 +03:00
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2020-05-28 21:40:53 +03:00
|
|
|
#pragma once
|
|
|
|
|
2022-02-27 03:38:12 +03:00
|
|
|
#include "ElementSizePreviewWidget.h"
|
2023-11-24 03:50:16 +03:00
|
|
|
#include <AK/StringView.h>
|
2020-02-06 22:33:02 +03:00
|
|
|
#include <LibGUI/Widget.h>
|
2020-03-07 12:32:51 +03:00
|
|
|
#include <LibWeb/Forward.h>
|
2022-02-27 03:38:12 +03:00
|
|
|
#include <LibWeb/Layout/BoxModelMetrics.h>
|
2022-04-30 11:46:33 +03:00
|
|
|
#include <LibWebView/Forward.h>
|
2023-02-25 20:42:57 +03:00
|
|
|
|
2020-05-08 22:38:30 +03:00
|
|
|
namespace Browser {
|
|
|
|
|
2020-02-02 17:07:41 +03:00
|
|
|
class InspectorWidget final : public GUI::Widget {
|
2020-01-02 16:55:19 +03:00
|
|
|
C_OBJECT(InspectorWidget)
|
2022-03-04 19:16:57 +03:00
|
|
|
|
2023-11-24 03:50:16 +03:00
|
|
|
public:
|
|
|
|
static NonnullRefPtr<InspectorWidget> create(WebView::OutOfProcessWebView& content_view);
|
|
|
|
virtual ~InspectorWidget();
|
2020-01-02 16:55:19 +03:00
|
|
|
|
2023-11-24 03:50:16 +03:00
|
|
|
void inspect();
|
|
|
|
void reset();
|
2020-01-02 16:55:19 +03:00
|
|
|
|
2021-08-27 22:21:30 +03:00
|
|
|
void select_default_node();
|
2023-11-24 03:50:16 +03:00
|
|
|
void select_hovered_node();
|
2021-08-27 19:40:25 +03:00
|
|
|
|
2020-01-02 16:55:19 +03:00
|
|
|
private:
|
2023-11-24 03:50:16 +03:00
|
|
|
explicit InspectorWidget(WebView::OutOfProcessWebView& content_view);
|
2020-01-02 16:55:19 +03:00
|
|
|
|
2022-12-19 01:49:09 +03:00
|
|
|
void load_style_json(StringView computed_values_json, StringView resolved_values_json, StringView custom_properties_json);
|
2021-08-27 22:21:30 +03:00
|
|
|
void clear_style_json();
|
2023-11-24 03:50:16 +03:00
|
|
|
|
|
|
|
void update_node_box_model(StringView node_box_sizing_json);
|
2022-07-03 18:56:26 +03:00
|
|
|
void clear_node_box_model();
|
2020-06-12 23:30:11 +03:00
|
|
|
|
2023-11-24 03:50:16 +03:00
|
|
|
void update_aria_properties_state_model(StringView aria_properties_state_json);
|
|
|
|
|
|
|
|
RefPtr<WebView::OutOfProcessWebView> m_inspector_view;
|
|
|
|
OwnPtr<WebView::InspectorClient> m_inspector_client;
|
2021-09-02 14:05:32 +03:00
|
|
|
|
2020-02-02 17:07:41 +03:00
|
|
|
RefPtr<GUI::TableView> m_computed_style_table_view;
|
2022-03-15 22:00:51 +03:00
|
|
|
RefPtr<GUI::TableView> m_resolved_style_table_view;
|
2021-12-08 14:51:26 +03:00
|
|
|
RefPtr<GUI::TableView> m_custom_properties_table_view;
|
2023-05-21 16:52:03 +03:00
|
|
|
RefPtr<GUI::TableView> m_aria_properties_state_view;
|
2022-02-27 03:38:12 +03:00
|
|
|
RefPtr<ElementSizePreviewWidget> m_element_size_view;
|
|
|
|
|
|
|
|
Web::Layout::BoxModelMetrics m_node_box_sizing;
|
2020-01-02 16:55:19 +03:00
|
|
|
};
|
2020-05-08 22:38:30 +03:00
|
|
|
|
|
|
|
}
|