diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-09-02 12:01:19 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-02 22:16:41 +0200 |
commit | 08aa7b77a7b4925c2694b999cadf4cc15a966455 (patch) | |
tree | 654c2384b2ec6e32c05f70440095a75ca2f76867 /Userland/Applications/Browser | |
parent | 1159eefff32b4053d7791b94eb1bea8ca447dd93 (diff) | |
download | serenity-08aa7b77a7b4925c2694b999cadf4cc15a966455.zip |
Browser: Remove residual InProcessWebView code from DOM Inspector
This is no longer useful, and has to go before I can change how the
Models work.
Diffstat (limited to 'Userland/Applications/Browser')
-rw-r--r-- | Userland/Applications/Browser/InspectorWidget.cpp | 45 | ||||
-rw-r--r-- | Userland/Applications/Browser/InspectorWidget.h | 8 |
2 files changed, 4 insertions, 49 deletions
diff --git a/Userland/Applications/Browser/InspectorWidget.cpp b/Userland/Applications/Browser/InspectorWidget.cpp index 3d7ad71857..615f12b58c 100644 --- a/Userland/Applications/Browser/InspectorWidget.cpp +++ b/Userland/Applications/Browser/InspectorWidget.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,43 +15,13 @@ #include <LibWeb/DOM/Element.h> #include <LibWeb/DOMTreeJSONModel.h> #include <LibWeb/DOMTreeModel.h> -#include <LibWeb/LayoutTreeModel.h> #include <LibWeb/StylePropertiesModel.h> namespace Browser { -void InspectorWidget::set_inspected_node(GUI::ModelIndex const index) +void InspectorWidget::set_inspected_node(GUI::ModelIndex const) { - if (!m_document) { - // FIXME: Handle this for OutOfProcessWebView - return; - } - auto* node = static_cast<Web::DOM::Node*>(index.internal_data()); - m_inspected_node = node; - m_document->set_inspected_node(node); - m_dom_tree_view->set_cursor(index, GUI::AbstractView::SelectionUpdate::Set); - m_dom_tree_view->expand_all_parents_of(index); - if (node && node->is_element()) { - auto& element = verify_cast<Web::DOM::Element>(*node); - if (element.specified_css_values()) { - m_style_table_view->set_model(Web::StylePropertiesModel::create(*element.specified_css_values())); - m_computed_style_table_view->set_model(Web::StylePropertiesModel::create(*element.computed_style())); - } - } else { - m_style_table_view->set_model(nullptr); - m_computed_style_table_view->set_model(nullptr); - } -} - -void InspectorWidget::set_inspected_node(Web::DOM::Node* requested_node) -{ - dbgln("Inspected node: {:p}", requested_node); - if (requested_node == nullptr) { - set_inspected_node(GUI::ModelIndex {}); - return; - } - - set_inspected_node(static_cast<Web::DOMTreeModel*>(m_dom_tree_view->model())->index_for_node(requested_node)); + // FIXME: Handle this for OutOfProcessWebView } InspectorWidget::InspectorWidget() @@ -82,16 +53,6 @@ InspectorWidget::~InspectorWidget() { } -void InspectorWidget::set_document(Web::DOM::Document* document) -{ - document->set_inspected_node(m_inspected_node); - if (m_document == document) - return; - m_document = document; - m_dom_tree_view->set_model(Web::DOMTreeModel::create(*document)); - m_layout_tree_view->set_model(Web::LayoutTreeModel::create(*document)); -} - void InspectorWidget::set_dom_json(String json) { if (m_dom_json.has_value() && m_dom_json.value() == json) diff --git a/Userland/Applications/Browser/InspectorWidget.h b/Userland/Applications/Browser/InspectorWidget.h index 5d1274e3a2..1f46c925a6 100644 --- a/Userland/Applications/Browser/InspectorWidget.h +++ b/Userland/Applications/Browser/InspectorWidget.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2021, Sam Atkins <atkinssj@gmail.com> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -16,9 +17,7 @@ class InspectorWidget final : public GUI::Widget { public: virtual ~InspectorWidget(); - void set_document(Web::DOM::Document*); void set_dom_json(String); - void set_inspected_node(Web::DOM::Node*); private: InspectorWidget(); @@ -30,11 +29,6 @@ private: RefPtr<GUI::TableView> m_style_table_view; RefPtr<GUI::TableView> m_computed_style_table_view; - RefPtr<Web::DOM::Node> m_inspected_node; - - // One of these will be available, depending on if we're - // in-process (m_document) or out-of-process (m_dom_json) - RefPtr<Web::DOM::Document> m_document; Optional<String> m_dom_json; }; |