ProcessingInstruction.h 774 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2021, the SerenityOS developers.
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/FlyString.h>
  8. #include <LibWeb/DOM/CharacterData.h>
  9. namespace Web::DOM {
  10. class ProcessingInstruction final : public CharacterData {
  11. public:
  12. using WrapperType = Bindings::ProcessingInstructionWrapper;
  13. ProcessingInstruction(Document&, String const& data, String const& target);
  14. virtual ~ProcessingInstruction() override = default;
  15. virtual FlyString node_name() const override { return m_target; }
  16. String const& target() const { return m_target; }
  17. private:
  18. String m_target;
  19. };
  20. template<>
  21. inline bool Node::fast_is<ProcessingInstruction>() const { return node_type() == (u16)NodeType::PROCESSING_INSTRUCTION_NODE; }
  22. }