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