1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibWeb: Rename BoxModelMetrics::full_margin() => margin_box()

This matches the other member names (padding_box() and border_box().)
This commit is contained in:
Andreas Kling 2020-06-12 13:36:39 +02:00
parent 260427f0ad
commit 9cbef10bdd
4 changed files with 6 additions and 6 deletions

View file

@ -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 { return {
m_margin.top.to_px(layout_node) + m_border.top.to_px(layout_node) + m_padding.top.to_px(layout_node), m_margin.top.to_px(layout_node) + m_border.top.to_px(layout_node) + m_padding.top.to_px(layout_node),

View file

@ -53,7 +53,7 @@ public:
float left; float left;
}; };
PixelBox full_margin(const LayoutNode&) const; PixelBox margin_box(const LayoutNode&) const;
PixelBox padding_box(const LayoutNode&) const; PixelBox padding_box(const LayoutNode&) const;
PixelBox border_box(const LayoutNode&) const; PixelBox border_box(const LayoutNode&) const;

View file

@ -150,7 +150,7 @@ void LayoutBlock::layout_block_children(LayoutMode layout_mode)
child_block.layout(layout_mode); child_block.layout(layout_mode);
if (!child_block.is_absolutely_positioned()) 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) { if (layout_mode != LayoutMode::Default) {
float max_width = 0; float max_width = 0;
@ -464,7 +464,7 @@ void LayoutBlock::compute_position()
+ box_model().padding().left.to_px(*this) + box_model().padding().left.to_px(*this)
+ box_model().offset().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); + box_model().offset().top.to_px(*this);
LayoutBlock* relevant_sibling = previous_sibling(); LayoutBlock* relevant_sibling = previous_sibling();
@ -477,7 +477,7 @@ void LayoutBlock::compute_position()
if (relevant_sibling) { if (relevant_sibling) {
auto& previous_sibling_style = relevant_sibling->box_model(); auto& previous_sibling_style = relevant_sibling->box_model();
position_y += relevant_sibling->effective_offset().y() + relevant_sibling->height(); 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 }); set_offset({ position_x, position_y });

View file

@ -146,7 +146,7 @@ Gfx::FloatPoint LayoutReplaced::calculate_position()
+ box_model().padding().left.to_px(*this) + box_model().padding().left.to_px(*this)
+ box_model().offset().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 }; return { x, y };
} }