ladybird/Libraries/LibHTML/Layout/LayoutInline.cpp
Andreas Kling 4e35bbffdd LibHTML: LayoutText should always use parent's style properties
This patch makes StyleProperties heap-allocated and ref-counted so that
a LayoutNode can be without one. The ref-counting also allows anonymous
blocks to share style with their parent block.

LayoutText never needs a StyleProperties, since text always inherits
style from its parent element. This is handled by style_properties().
2019-10-04 12:12:39 +02:00

22 lines
559 B
C++

#include <LibHTML/Layout/LayoutBlock.h>
#include <LibHTML/Layout/LayoutInline.h>
LayoutInline::LayoutInline(const Node& node, RefPtr<StyleProperties> style_properties)
: LayoutNode(&node, move(style_properties))
{
}
LayoutInline::~LayoutInline()
{
}
void LayoutInline::split_into_lines(LayoutBlock& container)
{
for_each_child([&](auto& child) {
if (child.is_inline()) {
static_cast<LayoutInline&>(child).split_into_lines(container);
} else {
// FIXME: Support block children of inlines.
}
});
}