ladybird/Libraries/LibHTML/Layout/LayoutBreak.cpp
Andreas Kling 6242459c0f LibHTML: Implement the <br> element for line breaking
The <br> element will produce a special LayoutBreak node in the layout
tree, which forces a break in the line layout whenever encountered.

This patch also makes LayoutBlock use the current line-height as the
minimum effective height for each line box. This ensures that having
multiple <br> elements in a row doesn't create 0-height line boxes.
2019-10-12 13:47:49 +02:00

17 lines
324 B
C++

#include <LibHTML/Layout/LayoutBlock.h>
#include <LibHTML/Layout/LayoutBreak.h>
LayoutBreak::LayoutBreak(const HTMLBRElement& element)
: LayoutNode(&element)
{
set_inline(true);
}
LayoutBreak::~LayoutBreak()
{
}
void LayoutBreak::split_into_lines(LayoutBlock& block)
{
block.line_boxes().append(LineBox());
}