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 {
|
|
|
|
|
2022-12-04 18:02:33 +00:00
|
|
|
ProcessingInstruction::ProcessingInstruction(Document& document, DeprecatedString const& data, DeprecatedString const& target)
|
2021-04-06 17:06:23 +01:00
|
|
|
: CharacterData(document, NodeType::PROCESSING_INSTRUCTION_NODE, data)
|
|
|
|
, m_target(target)
|
|
|
|
{
|
2023-01-10 06:28:20 -05:00
|
|
|
}
|
|
|
|
|
2023-01-28 12:33:35 -05:00
|
|
|
JS::ThrowCompletionOr<void> ProcessingInstruction::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-01-28 12:33:35 -05:00
|
|
|
MUST_OR_THROW_OOM(Base::initialize(realm));
|
2023-01-10 06:28:20 -05:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::ProcessingInstructionPrototype>(realm, "ProcessingInstruction"));
|
2023-01-28 12:33:35 -05:00
|
|
|
|
|
|
|
return {};
|
2021-04-06 17:06:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|