mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 12:27:35 +00:00
Browser+LibHTML: Deduplicate inspector code
The `DOMElementStyleModel` and `DOMComputedElementStyleModel` classes were replaced by the `StylePropertiesModel`.
This commit is contained in:
parent
988d1deca8
commit
2ced4c4ec7
7 changed files with 60 additions and 145 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue