/* * Copyright (c) 2018-2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::DOM { class CharacterData : public Node , public ChildNode , public NonDocumentTypeChildNode { WEB_PLATFORM_OBJECT(CharacterData, Node); public: virtual ~CharacterData() override = default; DeprecatedString const& data() const { return m_data; } void set_data(DeprecatedString); unsigned length() const { return m_data.length(); } WebIDL::ExceptionOr substring_data(size_t offset, size_t count) const; WebIDL::ExceptionOr append_data(DeprecatedString const&); WebIDL::ExceptionOr insert_data(size_t offset, DeprecatedString const&); WebIDL::ExceptionOr delete_data(size_t offset, size_t count); WebIDL::ExceptionOr replace_data(size_t offset, size_t count, DeprecatedString const&); protected: CharacterData(Document&, NodeType, DeprecatedString const&); virtual JS::ThrowCompletionOr initialize(JS::Realm&) override; private: DeprecatedString m_data; }; }