1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

LibWebView: Move DOMTreeModel to LibWebView

This patch has no functional changes.
This commit is contained in:
DexesTTP 2022-04-30 11:13:33 +02:00 committed by Andreas Kling
parent 97a67f5501
commit b797e1e2b9
5 changed files with 7 additions and 7 deletions

View file

@ -15,8 +15,8 @@
#include <LibGUI/TreeView.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/DOMTreeModel.h>
#include <LibWeb/StylePropertiesModel.h>
#include <LibWebView/DOMTreeModel.h>
#include <LibWebView/OutOfProcessWebView.h>
namespace Browser {
@ -29,7 +29,7 @@ void InspectorWidget::set_selection(Selection selection)
return;
}
auto* model = verify_cast<Web::DOMTreeModel>(m_dom_tree_view->model());
auto* model = verify_cast<WebView::DOMTreeModel>(m_dom_tree_view->model());
auto index = model->index_for_node(selection.dom_node_id, selection.pseudo_element);
if (!index.is_valid()) {
dbgln("InspectorWidget told to inspect non-existent node: {}", selection.to_string());
@ -131,7 +131,7 @@ void InspectorWidget::set_dom_json(String json)
return;
m_dom_json = json;
m_dom_tree_view->set_model(Web::DOMTreeModel::create(m_dom_json->view(), *m_dom_tree_view));
m_dom_tree_view->set_model(WebView::DOMTreeModel::create(m_dom_json->view(), *m_dom_tree_view));
if (m_pending_selection.has_value()) {
set_selection(m_pending_selection.release_value());

View file

@ -109,7 +109,6 @@ set(SOURCES
DOM/Text.idl
DOM/TreeWalker.cpp
DOMParsing/InnerHTML.cpp
DOMTreeModel.cpp
Dump.cpp
Encoding/TextDecoder.cpp
Encoding/TextEncoder.cpp

View file

@ -1,4 +1,5 @@
set(SOURCES
DOMTreeModel.cpp
OutOfProcessWebView.cpp
WebContentClient.cpp
)

View file

@ -12,7 +12,7 @@
#include <LibGfx/Palette.h>
#include <ctype.h>
namespace Web {
namespace WebView {
DOMTreeModel::DOMTreeModel(JsonObject dom_tree, GUI::TreeView& tree_view)
: m_tree_view(tree_view)
@ -214,7 +214,7 @@ GUI::ModelIndex DOMTreeModel::index_for_node(i32 node_id, Optional<Web::CSS::Sel
}
}
dbgln("Didn't find index for node {}, pseudo-element {}!", node_id, pseudo_element.has_value() ? CSS::pseudo_element_name(pseudo_element.value()) : "NONE");
dbgln("Didn't find index for node {}, pseudo-element {}!", node_id, pseudo_element.has_value() ? Web::CSS::pseudo_element_name(pseudo_element.value()) : "NONE");
return {};
}

View file

@ -13,7 +13,7 @@
#include <LibWeb/CSS/Selector.h>
#include <LibWeb/Forward.h>
namespace Web {
namespace WebView {
class DOMTreeModel final : public GUI::Model {
public: