mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
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.
This commit is contained in:
parent
f150134de9
commit
ee567cdc3d
11 changed files with 75 additions and 15 deletions
|
@ -12,6 +12,7 @@ class Document;
|
|||
class Element;
|
||||
class LayoutBlock;
|
||||
class LayoutNode;
|
||||
class LineBoxFragment;
|
||||
class Node;
|
||||
|
||||
struct HitTestResult {
|
||||
|
@ -53,6 +54,7 @@ public:
|
|||
virtual const char* class_name() const { return "LayoutNode"; }
|
||||
virtual bool is_text() const { return false; }
|
||||
virtual bool is_block() const { return false; }
|
||||
virtual bool is_replaced() const { return false; }
|
||||
|
||||
bool is_inline() const { return m_inline; }
|
||||
void set_inline(bool b) { m_inline = b; }
|
||||
|
@ -74,6 +76,8 @@ public:
|
|||
void inserted_into(LayoutNode&) {}
|
||||
void removed_from(LayoutNode&) {}
|
||||
|
||||
virtual void split_into_lines(LayoutBlock& container);
|
||||
|
||||
protected:
|
||||
explicit LayoutNode(const Node*, RefPtr<StyleProperties>);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue