summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-15 19:12:12 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-15 19:12:56 +0200
commit110b2d52f2a37c5ae376efb73a77a636a749bba4 (patch)
tree71740e33a9629f9c8ed29e4fca0da080074e572f
parent4814253589e87e23de4d4472bd09d8f32d7fb459 (diff)
downloadserenity-110b2d52f2a37c5ae376efb73a77a636a749bba4.zip
LibHTML: Fix missing backgrounds an borders after LayoutBox refactoring
The render() implementation in both LayoutBlock and LayoutBox need to be calling the immediate parent class. :^)
-rw-r--r--Libraries/LibHTML/Layout/LayoutBlock.cpp2
-rw-r--r--Libraries/LibHTML/Layout/LayoutBox.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibHTML/Layout/LayoutBlock.cpp b/Libraries/LibHTML/Layout/LayoutBlock.cpp
index 734ada9f00..31c1b95f7f 100644
--- a/Libraries/LibHTML/Layout/LayoutBlock.cpp
+++ b/Libraries/LibHTML/Layout/LayoutBlock.cpp
@@ -202,7 +202,7 @@ void LayoutBlock::render(RenderingContext& context)
if (!is_visible())
return;
- LayoutNode::render(context);
+ LayoutBox::render(context);
if (children_are_inline()) {
for (auto& line_box : m_line_boxes) {
diff --git a/Libraries/LibHTML/Layout/LayoutBox.cpp b/Libraries/LibHTML/Layout/LayoutBox.cpp
index 0e7d69afc9..54e0b24aad 100644
--- a/Libraries/LibHTML/Layout/LayoutBox.cpp
+++ b/Libraries/LibHTML/Layout/LayoutBox.cpp
@@ -9,6 +9,9 @@
void LayoutBox::render(RenderingContext& context)
{
+ if (!is_visible())
+ return;
+
#ifdef DRAW_BOXES_AROUND_LAYOUT_NODES
context.painter().draw_rect(m_rect, Color::Blue);
#endif
@@ -60,6 +63,8 @@ void LayoutBox::render(RenderingContext& context)
context.painter().draw_line(padded_rect.bottom_left(), padded_rect.top_left(), border_color, border_width);
}
}
+
+ LayoutNodeWithStyleAndBoxModelMetrics::render(context);
}
HitTestResult LayoutBox::hit_test(const Point& position) const