2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2020-11-22 11:53:01 -03:00
|
|
|
#include <LibWeb/Layout/BlockBox.h>
|
|
|
|
|
#include <LibWeb/Layout/BreakNode.h>
|
2020-12-05 16:10:39 -03:00
|
|
|
#include <LibWeb/Layout/InlineFormattingContext.h>
|
2019-10-12 08:47:49 -03:00
|
|
|
|
2020-11-22 11:53:01 -03:00
|
|
|
namespace Web::Layout {
|
2020-03-07 06:27:02 -03:00
|
|
|
|
2020-11-22 11:53:01 -03:00
|
|
|
BreakNode::BreakNode(DOM::Document& document, HTML::HTMLBRElement& element)
|
|
|
|
|
: Layout::NodeWithStyleAndBoxModelMetrics(document, &element, CSS::StyleProperties::create())
|
2019-10-12 08:47:49 -03:00
|
|
|
{
|
|
|
|
|
set_inline(true);
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-22 11:53:01 -03:00
|
|
|
BreakNode::~BreakNode()
|
2019-10-12 08:47:49 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-06 15:48:02 -03:00
|
|
|
void BreakNode::split_into_lines(InlineFormattingContext& context, LayoutMode)
|
2019-10-12 08:47:49 -03:00
|
|
|
{
|
2021-04-02 14:32:28 -03:00
|
|
|
auto& line_box = context.containing_block().add_line_box();
|
|
|
|
|
line_box.add_fragment(*this, 0, 0, 0, context.containing_block().line_height());
|
2019-10-12 08:47:49 -03:00
|
|
|
}
|
2020-03-07 06:27:02 -03:00
|
|
|
|
2021-09-15 09:53:44 -03:00
|
|
|
void BreakNode::paint(PaintContext&, PaintPhase)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-07 06:27:02 -03:00
|
|
|
}
|