mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:32:44 +00:00 
			
		
		
		
	 5f54b8dd6c
			
		
	
	
		5f54b8dd6c
		
	
	
	
	
		
			
			This isn't entirely on-spec, but will hopefully allow us to make progress in other areas.
		
			
				
	
	
		
			34 lines
		
	
	
	
		
			798 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
	
		
			798 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/DOM/Text.h>
 | |
| #include <LibWeb/DOM/Window.h>
 | |
| #include <LibWeb/HTML/HTMLInputElement.h>
 | |
| #include <LibWeb/Layout/TextNode.h>
 | |
| 
 | |
| namespace Web::DOM {
 | |
| 
 | |
| Text::Text(Document& document, const String& data)
 | |
|     : CharacterData(document, NodeType::TEXT_NODE, data)
 | |
| {
 | |
| }
 | |
| 
 | |
| Text::~Text()
 | |
| {
 | |
| }
 | |
| 
 | |
| // https://dom.spec.whatwg.org/#dom-text-text
 | |
| NonnullRefPtr<Text> Text::create_with_global_object(Bindings::WindowObject& window, String const& data)
 | |
| {
 | |
|     return make_ref_counted<Text>(window.impl().associated_document(), data);
 | |
| }
 | |
| 
 | |
| void Text::set_owner_input_element(Badge<HTML::HTMLInputElement>, HTML::HTMLInputElement& input_element)
 | |
| {
 | |
|     m_owner_input_element = input_element;
 | |
| }
 | |
| 
 | |
| }
 |