blob: 6b1b992d778bf3936863775ee941f4e15602da73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/DeprecatedString.h>
#include <LibWeb/DOM/ChildNode.h>
#include <LibWeb/DOM/Node.h>
#include <LibWeb/DOM/NonDocumentTypeChildNode.h>
namespace Web::DOM {
class CharacterData
: public Node
, public ChildNode<CharacterData>
, public NonDocumentTypeChildNode<CharacterData> {
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<DeprecatedString> substring_data(size_t offset, size_t count) const;
WebIDL::ExceptionOr<void> append_data(DeprecatedString const&);
WebIDL::ExceptionOr<void> insert_data(size_t offset, DeprecatedString const&);
WebIDL::ExceptionOr<void> delete_data(size_t offset, size_t count);
WebIDL::ExceptionOr<void> replace_data(size_t offset, size_t count, DeprecatedString const&);
protected:
CharacterData(Document&, NodeType, DeprecatedString const&);
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
private:
DeprecatedString m_data;
};
}
|