
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().
22 lines
559 B
C++
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.
|
|
}
|
|
});
|
|
}
|