diff --git a/Libraries/LibHTML/DOM/Node.cpp b/Libraries/LibHTML/DOM/Node.cpp
index 141985f026..b4203cc594 100644
--- a/Libraries/LibHTML/DOM/Node.cpp
+++ b/Libraries/LibHTML/DOM/Node.cpp
@@ -56,7 +56,7 @@ RefPtr Node::create_layout_tree(const StyleResolver& resolver, const
bool have_block_children = false;
static_cast(*this).for_each_child([&](const Node& child) {
- auto layout_child = child.create_layout_tree(resolver, &layout_node->style_properties());
+ auto layout_child = child.create_layout_tree(resolver, &layout_node->style());
if (!layout_child)
return;
if (!layout_child->is_block())
diff --git a/Libraries/LibHTML/Dump.cpp b/Libraries/LibHTML/Dump.cpp
index a7fffdb3cd..8cb17f3572 100644
--- a/Libraries/LibHTML/Dump.cpp
+++ b/Libraries/LibHTML/Dump.cpp
@@ -114,7 +114,7 @@ void dump_tree(const LayoutNode& layout_node)
}
}
- layout_node.style_properties().for_each_property([&](auto& key, auto& value) {
+ layout_node.style().for_each_property([&](auto& key, auto& value) {
for (int i = 0; i < indent; ++i)
dbgprintf(" ");
dbgprintf(" (%s: %s)\n", key.characters(), value.to_string().characters());
diff --git a/Libraries/LibHTML/Layout/LayoutBlock.cpp b/Libraries/LibHTML/Layout/LayoutBlock.cpp
index 5bf6470eac..afbbf50cc1 100644
--- a/Libraries/LibHTML/Layout/LayoutBlock.cpp
+++ b/Libraries/LibHTML/Layout/LayoutBlock.cpp
@@ -15,7 +15,7 @@ LayoutBlock::~LayoutBlock()
LayoutNode& LayoutBlock::inline_wrapper()
{
if (!last_child() || !last_child()->is_block() || last_child()->node() != nullptr) {
- append_child(adopt(*new LayoutBlock(nullptr, style_properties())));
+ append_child(adopt(*new LayoutBlock(nullptr, style())));
}
return *last_child();
}
@@ -75,7 +75,7 @@ void LayoutBlock::layout_inline_children()
void LayoutBlock::compute_width()
{
- auto& style_properties = this->style_properties();
+ auto& style_properties = this->style();
auto auto_value = Length();
auto zero_value = Length(0, Length::Type::Absolute);
@@ -149,7 +149,7 @@ void LayoutBlock::compute_width()
void LayoutBlock::compute_position()
{
- auto& style_properties = this->style_properties();
+ auto& style_properties = this->style();
auto auto_value = Length();
auto zero_value = Length(0, Length::Type::Absolute);
@@ -178,7 +178,7 @@ void LayoutBlock::compute_position()
void LayoutBlock::compute_height()
{
- auto& style_properties = this->style_properties();
+ auto& style_properties = this->style();
auto height_property = style_properties.property("height");
if (!height_property.has_value())
@@ -193,7 +193,7 @@ void LayoutBlock::render(RenderingContext& context)
LayoutNode::render(context);
// FIXME: position this properly
- if (style_properties().string_or_fallback("display", "block") == "list-item") {
+ if (style().string_or_fallback("display", "block") == "list-item") {
Rect bullet_rect {
rect().x() - 8,
rect().y() + 4,
diff --git a/Libraries/LibHTML/Layout/LayoutNode.cpp b/Libraries/LibHTML/Layout/LayoutNode.cpp
index 1640108b79..e1d3ebd5be 100644
--- a/Libraries/LibHTML/Layout/LayoutNode.cpp
+++ b/Libraries/LibHTML/Layout/LayoutNode.cpp
@@ -49,14 +49,14 @@ void LayoutNode::render(RenderingContext& context)
padded_rect.set_y(rect().y() - box_model().padding().top.to_px());
padded_rect.set_height(rect().height() + box_model().padding().top.to_px() + box_model().padding().bottom.to_px());
- auto bgcolor = style_properties().property("background-color");
+ auto bgcolor = style().property("background-color");
if (bgcolor.has_value() && bgcolor.value()->is_color()) {
context.painter().fill_rect(padded_rect, bgcolor.value()->to_color());
}
- auto border_width_value = style_properties().property("border-width");
- auto border_color_value = style_properties().property("border-color");
- auto border_style_value = style_properties().property("border-style");
+ auto border_width_value = style().property("border-width");
+ auto border_color_value = style().property("border-color");
+ auto border_style_value = style().property("border-style");
if (border_width_value.has_value() && border_color_value.has_value()) {
int border_width = border_width_value.value()->to_length().to_px();
Color border_color = border_color_value.value()->to_color();
diff --git a/Libraries/LibHTML/Layout/LayoutNode.h b/Libraries/LibHTML/Layout/LayoutNode.h
index 9c1fa199b9..2055a12f4e 100644
--- a/Libraries/LibHTML/Layout/LayoutNode.h
+++ b/Libraries/LibHTML/Layout/LayoutNode.h
@@ -62,11 +62,11 @@ public:
virtual LayoutNode& inline_wrapper() { return *this; }
- const StyleProperties& style_properties() const
+ const StyleProperties& style() const
{
if (m_style_properties)
return *m_style_properties;
- return parent()->style_properties();
+ return parent()->style();
}
void inserted_into(LayoutNode&) {}
diff --git a/Libraries/LibHTML/Layout/LayoutText.cpp b/Libraries/LibHTML/Layout/LayoutText.cpp
index bb2a68eb2a..8c21338715 100644
--- a/Libraries/LibHTML/Layout/LayoutText.cpp
+++ b/Libraries/LibHTML/Layout/LayoutText.cpp
@@ -18,8 +18,8 @@ LayoutText::~LayoutText()
void LayoutText::load_font()
{
- auto font_family = style_properties().string_or_fallback("font-family", "Katica");
- auto font_weight = style_properties().string_or_fallback("font-weight", "normal");
+ auto font_family = style().string_or_fallback("font-family", "Katica");
+ auto font_weight = style().string_or_fallback("font-weight", "normal");
String weight;
if (font_weight == "lighter")
@@ -78,11 +78,11 @@ static bool is_all_whitespace(const String& string)
return true;
}
-const String& LayoutText::text_for_style(const StyleProperties& style_properties) const
+const String& LayoutText::text_for_style(const StyleProperties& style) const
{
static String one_space = " ";
if (is_all_whitespace(node().data())) {
- if (style_properties.string_or_fallback("white-space", "normal") == "normal")
+ if (style.string_or_fallback("white-space", "normal") == "normal")
return one_space;
}
return node().data();
@@ -93,8 +93,8 @@ void LayoutText::render_fragment(RenderingContext& context, const LineBoxFragmen
auto& painter = context.painter();
painter.set_font(*m_font);
- auto color = style_properties().color_or_fallback("color", Color::Black);
- auto text_decoration = style_properties().string_or_fallback("text-decoration", "none");
+ auto color = style().color_or_fallback("color", Color::Black);
+ auto text_decoration = style().string_or_fallback("text-decoration", "none");
bool is_underline = text_decoration == "underline";
if (is_underline)
@@ -185,7 +185,7 @@ void LayoutText::split_into_lines(LayoutBlock& container)
line_boxes.append(LineBox());
int available_width = container.rect().width() - line_boxes.last().width();
- bool is_preformatted = style_properties().string_or_fallback("white-space", "normal") == "pre";
+ bool is_preformatted = style().string_or_fallback("white-space", "normal") == "pre";
if (is_preformatted) {
for_each_source_line([&](const Utf8View& view, int start, int length) {
line_boxes.last().add_fragment(*this, start, length, m_font->width(view), line_height);
diff --git a/Libraries/LibHTML/Layout/LayoutText.h b/Libraries/LibHTML/Layout/LayoutText.h
index 594cfbeee3..008e60ede6 100644
--- a/Libraries/LibHTML/Layout/LayoutText.h
+++ b/Libraries/LibHTML/Layout/LayoutText.h
@@ -22,7 +22,7 @@ public:
virtual void split_into_lines(LayoutBlock& container) override;
- const StyleProperties& style_properties() const { return parent()->style_properties(); }
+ const StyleProperties& style() const { return parent()->style(); }
private:
template