Serenity Operating System
1/*
2 * Copyright (c) 2021, the SerenityOS developers.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#include <AK/DeprecatedFlyString.h>
10#include <LibWeb/DOM/CharacterData.h>
11
12namespace Web::DOM {
13
14class ProcessingInstruction final : public CharacterData {
15 WEB_PLATFORM_OBJECT(ProcessingInstruction, CharacterData);
16
17public:
18 virtual ~ProcessingInstruction() override = default;
19
20 virtual DeprecatedFlyString node_name() const override { return m_target; }
21
22 DeprecatedString const& target() const { return m_target; }
23
24private:
25 ProcessingInstruction(Document&, DeprecatedString const& data, DeprecatedString const& target);
26
27 virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
28
29 DeprecatedString m_target;
30};
31
32template<>
33inline bool Node::fast_is<ProcessingInstruction>() const { return node_type() == (u16)NodeType::PROCESSING_INSTRUCTION_NODE; }
34
35}