#pragma once
#include "RenderBoxModelObject.h"
namespace WebCore {
class InlineElementBox;
class HTMLElement;
class Position;
class RenderLineBreak final : public RenderBoxModelObject {
WTF_MAKE_ISO_ALLOCATED(RenderLineBreak);
public:
RenderLineBreak(HTMLElement&, RenderStyle&&);
virtual ~RenderLineBreak();
const char* renderName() const final { return m_isWBR ? "RenderWordBreak" : "RenderBR"; }
bool isWBR() const final { return m_isWBR; }
std::unique_ptr<InlineElementBox> createInlineBox();
InlineElementBox* inlineBoxWrapper() const { return m_inlineBoxWrapper; }
void setInlineBoxWrapper(InlineElementBox*);
void deleteInlineBoxWrapper();
void replaceInlineBoxWrapper(InlineElementBox&);
void dirtyLineBoxes(bool fullLayout);
IntRect linesBoundingBox() const;
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final;
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed = nullptr) const final;
#if PLATFORM(IOS_FAMILY)
void collectSelectionRects(Vector<SelectionRect>&, unsigned startOffset = 0, unsigned endOffset = std::numeric_limits<unsigned>::max()) final;
#endif
private:
void node() const = delete;
bool canHaveChildren() const final { return false; }
void paint(PaintInfo&, const LayoutPoint&) final { }
VisiblePosition positionForPoint(const LayoutPoint&, const RenderFragmentContainer*) final;
int caretMinOffset() const final;
int caretMaxOffset() const final;
bool canBeSelectionLeaf() const final;
LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode) const final;
int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode) const final;
LayoutUnit marginTop() const final { return 0; }
LayoutUnit marginBottom() const final { return 0; }
LayoutUnit marginLeft() const final { return 0; }
LayoutUnit marginRight() const final { return 0; }
LayoutUnit marginBefore(const RenderStyle*) const final { return 0; }
LayoutUnit marginAfter(const RenderStyle*) const final { return 0; }
LayoutUnit marginStart(const RenderStyle*) const final { return 0; }
LayoutUnit marginEnd(const RenderStyle*) const final { return 0; }
LayoutUnit offsetWidth() const final { return linesBoundingBox().width(); }
LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); }
LayoutRect borderBoundingBox() const final { return LayoutRect(LayoutPoint(), linesBoundingBox().size()); }
LayoutRect frameRectForStickyPositioning() const final { ASSERT_NOT_REACHED(); return LayoutRect(); }
LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const final { return LayoutRect(); }
void updateFromStyle() final;
bool requiresLayer() const final { return false; }
InlineElementBox* m_inlineBoxWrapper;
mutable int m_cachedLineHeight;
bool m_isWBR;
};
}
SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderLineBreak, isLineBreak())