diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-06 11:09:38 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-06 11:26:31 +0200 |
commit | 1b7aa00768d2415626782a51ca0adcc2fe710eb1 (patch) | |
tree | 00e9a2c11aedf25964f77fe61aa9cf1b79d2a287 /Libraries | |
parent | 2a266db05bf0ce937fa28d5070ac5172d1da6ac6 (diff) | |
download | serenity-1b7aa00768d2415626782a51ca0adcc2fe710eb1.zip |
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.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutText.cpp | 3 | ||||
-rw-r--r-- | Libraries/LibHTML/Layout/LayoutText.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibHTML/Layout/LayoutText.cpp b/Libraries/LibHTML/Layout/LayoutText.cpp index 43b640f43f..99d6c9e722 100644 --- a/Libraries/LibHTML/Layout/LayoutText.cpp +++ b/Libraries/LibHTML/Layout/LayoutText.cpp @@ -8,8 +8,9 @@ #include <ctype.h> LayoutText::LayoutText(const Text& text) - : LayoutInline(text, {}) + : LayoutNode(&text, {}) { + set_inline(true); } LayoutText::~LayoutText() diff --git a/Libraries/LibHTML/Layout/LayoutText.h b/Libraries/LibHTML/Layout/LayoutText.h index 008e60ede6..9a70eb23f8 100644 --- a/Libraries/LibHTML/Layout/LayoutText.h +++ b/Libraries/LibHTML/Layout/LayoutText.h @@ -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; |