mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
LibWeb: Rename LayoutNode classes and move them into Layout namespace
Bring the names of various boxes closer to spec language. This should hopefully make things easier to understand and hack on. :^) Some notable changes: - LayoutNode -> Layout::Node - LayoutBox -> Layout::Box - LayoutBlock -> Layout::BlockBox - LayoutReplaced -> Layout::ReplacedBox - LayoutDocument -> Layout::InitialContainingBlockBox - LayoutText -> Layout::TextNode - LayoutInline -> Layout::InlineNode Note that this is not strictly a "box tree" as we also hang inline/text nodes in the same tree, and they don't generate boxes. (Instead, they contribute line box fragments to their containing block!)
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
|
||||
#include <LibWeb/Layout/BoxModelMetrics.h>
|
||||
|
||||
namespace Web {
|
||||
namespace Web::Layout {
|
||||
|
||||
PixelBox BoxModelMetrics::margin_box(const LayoutNode& layout_node) const
|
||||
PixelBox BoxModelMetrics::margin_box(const Node& layout_node) const
|
||||
{
|
||||
return {
|
||||
margin.top.to_px(layout_node) + border.top.to_px(layout_node) + padding.top.to_px(layout_node),
|
||||
@@ -38,7 +38,7 @@ PixelBox BoxModelMetrics::margin_box(const LayoutNode& layout_node) const
|
||||
};
|
||||
}
|
||||
|
||||
PixelBox BoxModelMetrics::padding_box(const LayoutNode& layout_node) const
|
||||
PixelBox BoxModelMetrics::padding_box(const Node& layout_node) const
|
||||
{
|
||||
return {
|
||||
padding.top.to_px(layout_node),
|
||||
@@ -48,7 +48,7 @@ PixelBox BoxModelMetrics::padding_box(const LayoutNode& layout_node) const
|
||||
};
|
||||
}
|
||||
|
||||
PixelBox BoxModelMetrics::border_box(const LayoutNode& layout_node) const
|
||||
PixelBox BoxModelMetrics::border_box(const Node& layout_node) const
|
||||
{
|
||||
return {
|
||||
border.top.to_px(layout_node) + padding.top.to_px(layout_node),
|
||||
|
||||
Reference in New Issue
Block a user