mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:02:44 +00:00 
			
		
		
		
	 b023308f5c
			
		
	
	
		b023308f5c
		
	
	
	
	
		
			
			This makes <style> elements reparse the CSS when their text child is programmatically changed.
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			587 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			587 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/DOM/CharacterData.h>
 | |
| #include <LibWeb/DOM/Document.h>
 | |
| 
 | |
| namespace Web::DOM {
 | |
| 
 | |
| CharacterData::CharacterData(Document& document, NodeType type, const String& data)
 | |
|     : Node(document, type)
 | |
|     , m_data(data)
 | |
| {
 | |
| }
 | |
| 
 | |
| CharacterData::~CharacterData()
 | |
| {
 | |
| }
 | |
| 
 | |
| void CharacterData::set_data(String data)
 | |
| {
 | |
|     if (m_data == data)
 | |
|         return;
 | |
|     m_data = move(data);
 | |
|     if (parent())
 | |
|         parent()->children_changed();
 | |
|     set_needs_style_update(true);
 | |
| }
 | |
| 
 | |
| }
 |