1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

Browser+LibHTML: Change the way computed styles are queried

This commit is contained in:
Matrix89 2020-01-04 03:09:22 +01:00 committed by Andreas Kling
parent 2ced4c4ec7
commit 2dd35916e5
4 changed files with 37 additions and 4 deletions

View file

@ -20,10 +20,10 @@ InspectorWidget::InspectorWidget(GWidget* parent)
node->document().set_inspected_node(node);
if (node->is_element()) {
auto element = to<Element>(*node);
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()));
if (element.resolved_style()) {
m_style_table_view->set_model(StylePropertiesModel::create(*element.resolved_style()));
m_computed_style_table_view->set_model(StylePropertiesModel::create(*element.computed_style()));
}
} else {
m_style_table_view->set_model(nullptr);
m_computed_style_table_view->set_model(nullptr);