Explorar o código

LibWebView: Move DOMTreeModel to LibWebView

This patch has no functional changes.
DexesTTP %!s(int64=3) %!d(string=hai) anos
pai
achega
b797e1e2b9

+ 3 - 3
Userland/Applications/Browser/InspectorWidget.cpp

@@ -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());

+ 0 - 1
Userland/Libraries/LibWeb/CMakeLists.txt

@@ -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

+ 1 - 0
Userland/Libraries/LibWebView/CMakeLists.txt

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

+ 2 - 2
Userland/Libraries/LibWeb/DOMTreeModel.cpp → Userland/Libraries/LibWebView/DOMTreeModel.cpp

@@ -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 {};
 }
 

+ 1 - 1
Userland/Libraries/LibWeb/DOMTreeModel.h → Userland/Libraries/LibWebView/DOMTreeModel.h

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