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
|
|
|
*/
|
|
|
|
|
2022-12-13 13:24:27 +01:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
|
#include <LibWeb/DOM/Document.h>
|
2021-04-06 17:06:23 +01:00
|
|
|
#include <LibWeb/DOM/ProcessingInstruction.h>
|
|
|
|
#include <LibWeb/Layout/TextNode.h>
|
|
|
|
|
|
|
|
namespace Web::DOM {
|
|
|
|
|
2023-11-19 19:47:52 +01:00
|
|
|
JS_DEFINE_ALLOCATOR(ProcessingInstruction);
|
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
ProcessingInstruction::ProcessingInstruction(Document& document, DeprecatedString const& data, DeprecatedString const& target)
|
2023-09-07 21:36:05 +12:00
|
|
|
: CharacterData(document, NodeType::PROCESSING_INSTRUCTION_NODE, MUST(String::from_deprecated_string(data)))
|
2021-04-06 17:06:23 +01:00
|
|
|
, m_target(target)
|
|
|
|
{
|
2023-01-10 06:28:20 -05:00
|
|
|
}
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void ProcessingInstruction::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2023-11-22 12:55:21 +13:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::ProcessingInstructionPrototype>(realm, "ProcessingInstruction"_fly_string));
|
2021-04-06 17:06:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|