
This patch makes StyleProperties heap-allocated and ref-counted so that a LayoutNode can be without one. The ref-counting also allows anonymous blocks to share style with their parent block. LayoutText never needs a StyleProperties, since text always inherits style from its parent element. This is handled by style_properties().
16 lines
491 B
C++
16 lines
491 B
C++
#pragma once
|
|
|
|
#include <LibHTML/DOM/Document.h>
|
|
#include <LibHTML/Layout/LayoutBlock.h>
|
|
|
|
class LayoutDocument final : public LayoutBlock {
|
|
public:
|
|
explicit LayoutDocument(const Document&, NonnullRefPtr<StyleProperties>);
|
|
virtual ~LayoutDocument() override;
|
|
|
|
const Document& node() const { return static_cast<const Document&>(*LayoutNode::node()); }
|
|
virtual const char* class_name() const override { return "LayoutDocument"; }
|
|
virtual void layout() override;
|
|
|
|
private:
|
|
};
|