From 9cbef10bdd215e883b49eeb96d24395a496c1169 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 12 Jun 2020 13:36:39 +0200 Subject: [PATCH] LibWeb: Rename BoxModelMetrics::full_margin() => margin_box() This matches the other member names (padding_box() and border_box().) --- Libraries/LibWeb/Layout/BoxModelMetrics.cpp | 2 +- Libraries/LibWeb/Layout/BoxModelMetrics.h | 2 +- Libraries/LibWeb/Layout/LayoutBlock.cpp | 6 +++--- Libraries/LibWeb/Layout/LayoutReplaced.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/LibWeb/Layout/BoxModelMetrics.cpp b/Libraries/LibWeb/Layout/BoxModelMetrics.cpp index 5843783ae7..b6a6f3b7a8 100644 --- a/Libraries/LibWeb/Layout/BoxModelMetrics.cpp +++ b/Libraries/LibWeb/Layout/BoxModelMetrics.cpp @@ -36,7 +36,7 @@ BoxModelMetrics::~BoxModelMetrics() { } -BoxModelMetrics::PixelBox BoxModelMetrics::full_margin(const LayoutNode& layout_node) const +BoxModelMetrics::PixelBox BoxModelMetrics::margin_box(const LayoutNode& layout_node) const { return { m_margin.top.to_px(layout_node) + m_border.top.to_px(layout_node) + m_padding.top.to_px(layout_node), diff --git a/Libraries/LibWeb/Layout/BoxModelMetrics.h b/Libraries/LibWeb/Layout/BoxModelMetrics.h index 40bc014cf6..faa0462369 100644 --- a/Libraries/LibWeb/Layout/BoxModelMetrics.h +++ b/Libraries/LibWeb/Layout/BoxModelMetrics.h @@ -53,7 +53,7 @@ public: float left; }; - PixelBox full_margin(const LayoutNode&) const; + PixelBox margin_box(const LayoutNode&) const; PixelBox padding_box(const LayoutNode&) const; PixelBox border_box(const LayoutNode&) const; diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp index bc7d7f3191..e1a2b66a30 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.cpp +++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp @@ -150,7 +150,7 @@ void LayoutBlock::layout_block_children(LayoutMode layout_mode) child_block.layout(layout_mode); if (!child_block.is_absolutely_positioned()) - content_height = max(content_height, child_block.effective_offset().y() + child_block.height() + child_block.box_model().full_margin(*this).bottom); + content_height = max(content_height, child_block.effective_offset().y() + child_block.height() + child_block.box_model().margin_box(*this).bottom); }); if (layout_mode != LayoutMode::Default) { float max_width = 0; @@ -464,7 +464,7 @@ void LayoutBlock::compute_position() + box_model().padding().left.to_px(*this) + box_model().offset().left.to_px(*this); - float position_y = box_model().full_margin(*this).top + float position_y = box_model().margin_box(*this).top + box_model().offset().top.to_px(*this); LayoutBlock* relevant_sibling = previous_sibling(); @@ -477,7 +477,7 @@ void LayoutBlock::compute_position() if (relevant_sibling) { auto& previous_sibling_style = relevant_sibling->box_model(); position_y += relevant_sibling->effective_offset().y() + relevant_sibling->height(); - position_y += previous_sibling_style.full_margin(*this).bottom; + position_y += previous_sibling_style.margin_box(*this).bottom; } set_offset({ position_x, position_y }); diff --git a/Libraries/LibWeb/Layout/LayoutReplaced.cpp b/Libraries/LibWeb/Layout/LayoutReplaced.cpp index 8c17d33b21..1d911e8461 100644 --- a/Libraries/LibWeb/Layout/LayoutReplaced.cpp +++ b/Libraries/LibWeb/Layout/LayoutReplaced.cpp @@ -146,7 +146,7 @@ Gfx::FloatPoint LayoutReplaced::calculate_position() + box_model().padding().left.to_px(*this) + box_model().offset().left.to_px(*this); - float y = box_model().full_margin(*this).top + box_model().offset().top.to_px(*this); + float y = box_model().margin_box(*this).top + box_model().offset().top.to_px(*this); return { x, y }; }