mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
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:
parent
2a266db05b
commit
1b7aa00768
Notes:
sideshowbarker
2024-07-19 11:48:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1b7aa00768d
2 changed files with 4 additions and 3 deletions
|
@ -8,8 +8,9 @@
|
|||
#include <ctype.h>
|
||||
|
||||
LayoutText::LayoutText(const Text& text)
|
||||
: LayoutInline(text, {})
|
||||
: LayoutNode(&text, {})
|
||||
{
|
||||
set_inline(true);
|
||||
}
|
||||
|
||||
LayoutText::~LayoutText()
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue