
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.
17 lines
550 B
C++
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;
|
|
};
|