LibWeb: Rename Element::resolved_style() => specified_css_values()

This object represents the specified CSS values, so let's call it that.
This commit is contained in:
Andreas Kling 2021-01-06 11:42:01 +01:00
parent 2cc39cfb0e
commit ba8990fb6c
Notes: sideshowbarker 2024-07-19 00:04:45 +09:00
3 changed files with 7 additions and 7 deletions

View file

@ -43,8 +43,8 @@ void InspectorWidget::set_inspected_node(Web::DOM::Node* node)
m_document->set_inspected_node(node);
if (node && node->is_element()) {
auto& element = downcast<Web::DOM::Element>(*node);
if (element.resolved_style()) {
m_style_table_view->set_model(Web::StylePropertiesModel::create(*element.resolved_style()));
if (element.specified_css_values()) {
m_style_table_view->set_model(Web::StylePropertiesModel::create(*element.specified_css_values()));
m_computed_style_table_view->set_model(Web::StylePropertiesModel::create(*element.computed_style()));
}
} else {

View file

@ -114,7 +114,7 @@ bool Element::has_class(const FlyString& class_name) const
RefPtr<Layout::Node> Element::create_layout_node(const CSS::StyleProperties* parent_style)
{
auto style = document().style_resolver().resolve_style(*this, parent_style);
const_cast<Element&>(*this).m_resolved_style = style;
const_cast<Element&>(*this).m_specified_css_values = style;
auto display = style->display();
if (display == CSS::Display::None)
@ -203,7 +203,7 @@ void Element::recompute_style()
return;
ASSERT(parent_layout_node);
auto style = document().style_resolver().resolve_style(*this, &parent_layout_node->specified_style());
m_resolved_style = style;
m_specified_css_values = style;
if (!layout_node()) {
if (style->display() == CSS::Display::None)
return;
@ -233,7 +233,7 @@ void Element::recompute_style()
NonnullRefPtr<CSS::StyleProperties> Element::computed_style()
{
auto properties = m_resolved_style->clone();
auto properties = m_specified_css_values->clone();
if (layout_node() && layout_node()->has_style()) {
CSS::PropertyID box_model_metrics[] = {
CSS::PropertyID::MarginTop,

View file

@ -86,7 +86,7 @@ public:
String name() const { return attribute(HTML::AttributeNames::name); }
const CSS::StyleProperties* resolved_style() const { return m_resolved_style.ptr(); }
const CSS::StyleProperties* specified_css_values() const { return m_specified_css_values.ptr(); }
NonnullRefPtr<CSS::StyleProperties> computed_style();
const CSS::StyleDeclaration* inline_style() const { return m_inline_style; }
@ -110,7 +110,7 @@ private:
RefPtr<CSS::StyleDeclaration> m_inline_style;
RefPtr<CSS::StyleProperties> m_resolved_style;
RefPtr<CSS::StyleProperties> m_specified_css_values;
Vector<FlyString> m_classes;
};