mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibHTML: Add LayoutNodeWithStyle class, make LayoutText style-less
Since LayoutText always inherits style, it shouldn't store any style of its own. This patch adds a LayoutNodeWithStyle class to sit between LayoutNode and everyone who wants to inherit from LayoutNode except LayoutText :^) Since LayoutText can never have children, we also know that the parent of any LayoutNode is always going to be a LayoutNodeWithStyle. So this patch makes LayoutNode::parent() return LayoutNodeWithStyle*.
This commit is contained in:
parent
15f3e64862
commit
749e3f0f30
Notes:
sideshowbarker
2024-07-19 11:46:06 +09:00
Author: https://github.com/awesomekling
Commit: 749e3f0f30
9 changed files with 46 additions and 17 deletions
|
@ -1,7 +1,7 @@
|
|||
#include <LibHTML/DOM/Element.h>
|
||||
#include <LibHTML/Layout/LayoutNode.h>
|
||||
|
||||
class LayoutReplaced : public LayoutNode {
|
||||
class LayoutReplaced : public LayoutNodeWithStyle {
|
||||
public:
|
||||
LayoutReplaced(const Element&, NonnullRefPtr<StyleProperties>);
|
||||
virtual ~LayoutReplaced() override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue