LibHTML: LayoutText should inherit from LayoutNode directly

There's no need for LayoutText to inherit from LayoutInline.
I had the wrong idea here: I was thinking that everything that can be
laid out inline should inherit from LayoutInline, but that's clearly
not sufficient for something like LayoutReplaced which can be laid out
in either way.
This commit is contained in:
Andreas Kling 2019-10-06 11:09:38 +02:00
parent 2a266db05b
commit 1b7aa00768
Notes: sideshowbarker 2024-07-19 11:48:07 +09:00
2 changed files with 4 additions and 3 deletions

View file

@ -8,8 +8,9 @@
#include <ctype.h>
LayoutText::LayoutText(const Text& text)
: LayoutInline(text, {})
: LayoutNode(&text, {})
{
set_inline(true);
}
LayoutText::~LayoutText()

View file

@ -1,12 +1,12 @@
#pragma once
#include <LibHTML/DOM/Text.h>
#include <LibHTML/Layout/LayoutInline.h>
#include <LibHTML/Layout/LayoutNode.h>
class Font;
class LineBoxFragment;
class LayoutText : public LayoutInline {
class LayoutText : public LayoutNode {
public:
explicit LayoutText(const Text&);
virtual ~LayoutText() override;