mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 12:12:53 +00:00
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.
16 lines
471 B
C++
16 lines
471 B
C++
#pragma once
|
|
|
|
#include <LibHTML/DOM/HTMLBRElement.h>
|
|
#include <LibHTML/Layout/LayoutNode.h>
|
|
|
|
class LayoutBreak final : public LayoutNode {
|
|
public:
|
|
explicit LayoutBreak(const HTMLBRElement&);
|
|
virtual ~LayoutBreak() override;
|
|
|
|
const HTMLBRElement& node() const { return to<HTMLBRElement>(*LayoutNode::node()); }
|
|
|
|
private:
|
|
virtual const char* class_name() const override { return "LayoutBreak"; }
|
|
virtual void split_into_lines(LayoutBlock&) override;
|
|
};
|