mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
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:
parent
2cc39cfb0e
commit
ba8990fb6c
3 changed files with 7 additions and 7 deletions
|
@ -43,8 +43,8 @@ void InspectorWidget::set_inspected_node(Web::DOM::Node* node)
|
||||||
m_document->set_inspected_node(node);
|
m_document->set_inspected_node(node);
|
||||||
if (node && node->is_element()) {
|
if (node && node->is_element()) {
|
||||||
auto& element = downcast<Web::DOM::Element>(*node);
|
auto& element = downcast<Web::DOM::Element>(*node);
|
||||||
if (element.resolved_style()) {
|
if (element.specified_css_values()) {
|
||||||
m_style_table_view->set_model(Web::StylePropertiesModel::create(*element.resolved_style()));
|
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()));
|
m_computed_style_table_view->set_model(Web::StylePropertiesModel::create(*element.computed_style()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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)
|
RefPtr<Layout::Node> Element::create_layout_node(const CSS::StyleProperties* parent_style)
|
||||||
{
|
{
|
||||||
auto style = document().style_resolver().resolve_style(*this, 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();
|
auto display = style->display();
|
||||||
|
|
||||||
if (display == CSS::Display::None)
|
if (display == CSS::Display::None)
|
||||||
|
@ -203,7 +203,7 @@ void Element::recompute_style()
|
||||||
return;
|
return;
|
||||||
ASSERT(parent_layout_node);
|
ASSERT(parent_layout_node);
|
||||||
auto style = document().style_resolver().resolve_style(*this, &parent_layout_node->specified_style());
|
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 (!layout_node()) {
|
||||||
if (style->display() == CSS::Display::None)
|
if (style->display() == CSS::Display::None)
|
||||||
return;
|
return;
|
||||||
|
@ -233,7 +233,7 @@ void Element::recompute_style()
|
||||||
|
|
||||||
NonnullRefPtr<CSS::StyleProperties> Element::computed_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()) {
|
if (layout_node() && layout_node()->has_style()) {
|
||||||
CSS::PropertyID box_model_metrics[] = {
|
CSS::PropertyID box_model_metrics[] = {
|
||||||
CSS::PropertyID::MarginTop,
|
CSS::PropertyID::MarginTop,
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
|
|
||||||
String name() const { return attribute(HTML::AttributeNames::name); }
|
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();
|
NonnullRefPtr<CSS::StyleProperties> computed_style();
|
||||||
|
|
||||||
const CSS::StyleDeclaration* inline_style() const { return m_inline_style; }
|
const CSS::StyleDeclaration* inline_style() const { return m_inline_style; }
|
||||||
|
@ -110,7 +110,7 @@ private:
|
||||||
|
|
||||||
RefPtr<CSS::StyleDeclaration> m_inline_style;
|
RefPtr<CSS::StyleDeclaration> m_inline_style;
|
||||||
|
|
||||||
RefPtr<CSS::StyleProperties> m_resolved_style;
|
RefPtr<CSS::StyleProperties> m_specified_css_values;
|
||||||
|
|
||||||
Vector<FlyString> m_classes;
|
Vector<FlyString> m_classes;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue