/* * Copyright (c) 2022, Jonah Shafran * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include namespace Web::DOM { class AccessibilityTreeNode final : public JS::Cell { JS_CELL(AccessibilityTreeNode, JS::Cell) public: static WebIDL::ExceptionOr> create(Document*, DOM::Node const*); virtual ~AccessibilityTreeNode() override = default; JS::GCPtr value() const { return m_value; } void set_value(JS::GCPtr value) { m_value = value; } Vector> children() const { return m_children; } void append_child(AccessibilityTreeNode* child) { m_children.append(child); } void serialize_tree_as_json(JsonObjectSerializer& object, Document const&) const; protected: virtual void visit_edges(Visitor&) override; private: explicit AccessibilityTreeNode(JS::GCPtr); JS::GCPtr m_value; Vector> m_children; }; }