mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 02:33:03 +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.
17 lines
480 B
C++
17 lines
480 B
C++
#pragma once
|
|
|
|
#include <LibHTML/DOM/HTMLElement.h>
|
|
|
|
class HTMLBRElement final : public HTMLElement {
|
|
public:
|
|
HTMLBRElement(Document&, const String& tag_name);
|
|
virtual ~HTMLBRElement() override;
|
|
|
|
virtual RefPtr<LayoutNode> create_layout_node(const StyleResolver&, const StyleProperties* parent_style) const override;
|
|
};
|
|
|
|
template<>
|
|
inline bool is<HTMLBRElement>(const Node& node)
|
|
{
|
|
return is<Element>(node) && to<Element>(node).tag_name().to_lowercase() == "br";
|
|
}
|