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);
|
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-09-17 10:51:43 +12:00
|
|
|
virtual FlyString node_name() const override { return MUST(FlyString::from_deprecated_fly_string(m_target)); }
|
2021-04-06 17:06:23 +01:00
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString const& target() const { return m_target; }
|
2021-04-06 17:06:23 +01:00
|
|
|
|
|
|
|
|
private:
|
2022-12-04 18:02:33 +00:00
|
|
|
ProcessingInstruction(Document&, DeprecatedString const& data, DeprecatedString 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
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
DeprecatedString 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
|
|
|
}
|