ladybird/Libraries/LibHTML/Layout/LayoutReplaced.h
Andreas Kling ee567cdc3d LibHTML: Implement basic layout for inline <img alt>
LayoutReplaced objects can now participate in inline layout.

It's very hackish, but basically LayoutReplaced will just add itself to
the last line in the containing block.

This patch gets rid of the idea that only LayoutInline subclasses can
be split into lines, by moving the split_into_lines() virtual up to
LayoutNode and overriding it in LayoutReplaced.
2019-10-05 23:29:01 +02:00

17 lines
550 B
C++

#include <LibHTML/DOM/Element.h>
#include <LibHTML/Layout/LayoutNode.h>
class LayoutReplaced : public LayoutNode {
public:
LayoutReplaced(const Element&, NonnullRefPtr<StyleProperties>);
virtual ~LayoutReplaced() override;
const Element& node() const { return static_cast<const Element&>(*LayoutNode::node()); }
virtual bool is_replaced() const final { return true; }
private:
virtual const char* class_name() const override { return "LayoutReplaced"; }
virtual void split_into_lines(LayoutBlock& container) override;
};