summaryrefslogtreecommitdiff
path: root/Applications/Browser
diff options
context:
space:
mode:
authorMatrix89 <Matrix89@protonmail.ch>2020-01-04 01:15:42 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-05 17:13:22 +0100
commit2ced4c4ec745d1387be0e3a320596fd7b1597185 (patch)
tree5d20b9e7fb2edd9f9c0b1413f47cbd587d68f0d3 /Applications/Browser
parent988d1deca87420c74d52edaae45608ccce39591e (diff)
downloadserenity-2ced4c4ec745d1387be0e3a320596fd7b1597185.zip
Browser+LibHTML: Deduplicate inspector code
The `DOMElementStyleModel` and `DOMComputedElementStyleModel` classes were replaced by the `StylePropertiesModel`.
Diffstat (limited to 'Applications/Browser')
-rw-r--r--Applications/Browser/InspectorWidget.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Applications/Browser/InspectorWidget.cpp b/Applications/Browser/InspectorWidget.cpp
index e3cad9c67a..946ac64f71 100644
--- a/Applications/Browser/InspectorWidget.cpp
+++ b/Applications/Browser/InspectorWidget.cpp
@@ -6,9 +6,8 @@
#include <LibGUI/GTabWidget.h>
#include <LibHTML/DOM/Document.h>
#include <LibHTML/DOM/Element.h>
-#include <LibHTML/DOMElementStyleModel.h>
-#include <LibHTML/DOMComputedElementStyleModel.h>
#include <LibHTML/DOMTreeModel.h>
+#include <LibHTML/StylePropertiesModel.h>
InspectorWidget::InspectorWidget(GWidget* parent)
: GWidget(parent)
@@ -21,8 +20,10 @@ InspectorWidget::InspectorWidget(GWidget* parent)
node->document().set_inspected_node(node);
if (node->is_element()) {
auto element = to<Element>(*node);
- m_style_table_view->set_model(DOMElementStyleModel::create(element));
- m_computed_style_table_view->set_model(DOMComputedElementStyleModel::create(element));
+ if (element.resolved_style())
+ m_style_table_view->set_model(StylePropertiesModel::create(*element.resolved_style()));
+ if (element.layout_node() && element.layout_node()->has_style())
+ m_computed_style_table_view->set_model(StylePropertiesModel::create(element.layout_node()->style()));
} else {
m_style_table_view->set_model(nullptr);
m_computed_style_table_view->set_model(nullptr);