mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 21:45:08 +00:00

Inline layout is now done by LayoutBlock. Blocks with inline children will split them into line boxes during layout. A LayoutBlock can have zero or more LineBox objects. Each LineBox represents one visual line. A LineBox can have any number of LineBoxFragment children. A fragment is an offset+length into a specific LayoutNode. To paint a LayoutBlock with inline children, we walk its line boxes, and walk their fragments, painting each fragment at a time by calling LineBoxFragment::render(), which in turn calls the LayoutNode via LayoutText::render_fragment(). Hit testing works similarly. This is very incomplete and has many bugs, but should make it easier for us to move forward with this code.
21 lines
477 B
C++
21 lines
477 B
C++
#pragma once
|
|
|
|
#include <LibHTML/Layout/LayoutNode.h>
|
|
|
|
class Element;
|
|
class LayoutBlock;
|
|
|
|
class LayoutInline : public LayoutNode {
|
|
public:
|
|
LayoutInline(const Node&, StyleProperties&&);
|
|
virtual ~LayoutInline() override;
|
|
|
|
virtual const char* class_name() const override { return "LayoutInline"; }
|
|
virtual bool is_inline() const override { return true; }
|
|
|
|
virtual void layout() override;
|
|
|
|
virtual void split_into_lines(LayoutBlock& container);
|
|
|
|
private:
|
|
};
|