mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:32:44 +00:00 
			
		
		
		
	 24e25fe3d0
			
		
	
	
		24e25fe3d0
		
	
	
	
	
		
			
			Note that we don't queue mutation records or update live ranges yet, I've left those as FIXMEs.
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			936 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			936 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/String.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> {
 | |
| public:
 | |
|     using WrapperType = Bindings::CharacterDataWrapper;
 | |
| 
 | |
|     virtual ~CharacterData() override = default;
 | |
| 
 | |
|     const String& data() const { return m_data; }
 | |
|     void set_data(String);
 | |
| 
 | |
|     unsigned length() const { return m_data.length(); }
 | |
| 
 | |
|     ExceptionOr<String> substring_data(size_t offset, size_t count) const;
 | |
|     ExceptionOr<void> replace_data(size_t offset, size_t count, String const&);
 | |
| 
 | |
| protected:
 | |
|     explicit CharacterData(Document&, NodeType, const String&);
 | |
| 
 | |
| private:
 | |
|     String m_data;
 | |
| };
 | |
| 
 | |
| }
 |