mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
Remove includes from Node.h that are only needed for forward declarations (AccessibilityTreeNode.h, XMLSerializer.h, JsonObjectSerializer.h). Extract StyleInvalidationReason and FragmentSerializationMode enums into standalone lightweight headers so downstream headers (CSSStyleSheet.h, CSSStyleProperties.h, HTMLParser.h) can include just the enum they need instead of all of Node.h. Replace Node.h with forward declarations in headers that only use Node by pointer/reference. This breaks the circular dependency between Node.h and AccessibilityTreeNode.h, reducing AccessibilityTreeNode.h's recompilation footprint from ~1399 to ~25 files.
34 lines
725 B
C++
34 lines
725 B
C++
/*
|
|
* Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/DOM/NodeList.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
class StaticNodeList final : public NodeList {
|
|
WEB_PLATFORM_OBJECT(StaticNodeList, NodeList);
|
|
GC_DECLARE_ALLOCATOR(StaticNodeList);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<NodeList> create(JS::Realm&, Vector<GC::Root<Node>>);
|
|
|
|
virtual ~StaticNodeList() override;
|
|
|
|
virtual u32 length() const override;
|
|
virtual Node const* item(u32 index) const override;
|
|
|
|
private:
|
|
StaticNodeList(JS::Realm&, Vector<GC::Root<Node>>);
|
|
|
|
virtual void visit_edges(Cell::Visitor&) override;
|
|
|
|
Vector<GC::Ref<Node>> m_static_nodes;
|
|
};
|
|
|
|
}
|