2021-04-06 13:06:23 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-04-06 13:06:23 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/DOM/CharacterData.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
|
|
|
|
|
class ProcessingInstruction final : public CharacterData {
|
2022-08-28 08:42:07 -03:00
|
|
|
WEB_PLATFORM_OBJECT(ProcessingInstruction, CharacterData);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(ProcessingInstruction);
|
2021-04-06 13:06:23 -03:00
|
|
|
|
2022-08-28 08:42:07 -03:00
|
|
|
public:
|
2022-03-14 16:21:51 -03:00
|
|
|
virtual ~ProcessingInstruction() override = default;
|
2021-04-06 13:06:23 -03:00
|
|
|
|
2023-12-23 23:41:50 -03:00
|
|
|
virtual FlyString node_name() const override { return m_target; }
|
2021-04-06 13:06:23 -03:00
|
|
|
|
2023-12-23 23:41:50 -03:00
|
|
|
String const& target() const { return m_target; }
|
2021-04-06 13:06:23 -03:00
|
|
|
|
|
|
|
|
private:
|
2025-07-24 13:05:52 -03:00
|
|
|
ProcessingInstruction(Document&, Utf16String data, String const& target);
|
2022-08-28 08:42:07 -03:00
|
|
|
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(JS::Realm&) override;
|
2023-01-10 08:28:20 -03:00
|
|
|
|
2023-12-23 23:41:50 -03:00
|
|
|
String m_target;
|
2021-04-06 13:06:23 -03:00
|
|
|
};
|
|
|
|
|
|
2022-03-29 18:28:17 -03:00
|
|
|
template<>
|
|
|
|
|
inline bool Node::fast_is<ProcessingInstruction>() const { return node_type() == (u16)NodeType::PROCESSING_INSTRUCTION_NODE; }
|
|
|
|
|
|
2021-04-06 13:06:23 -03:00
|
|
|
}
|