mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 05:10:57 +00:00 
			
		
		
		
	 7e1bf4d300
			
		
	
	
		7e1bf4d300
		
	
	
	
	
		
			
			Instead of making each Layout::Node compute style for itself, we now compute it in TreeBuilder before even calling create_layout_node(). For non-element DOM nodes, we create the style and layout tree node in TreeBuilder. This allows us to move create_layout_node() from DOM::Node to DOM::Element.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			674 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			674 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, the SerenityOS developers.
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/DOM/Document.h>
 | |
| #include <LibWeb/HTML/HTMLLabelElement.h>
 | |
| #include <LibWeb/Layout/Label.h>
 | |
| 
 | |
| namespace Web::HTML {
 | |
| 
 | |
| HTMLLabelElement::HTMLLabelElement(DOM::Document& document, QualifiedName qualified_name)
 | |
|     : HTMLElement(document, move(qualified_name))
 | |
| {
 | |
| }
 | |
| 
 | |
| HTMLLabelElement::~HTMLLabelElement()
 | |
| {
 | |
| }
 | |
| 
 | |
| RefPtr<Layout::Node> HTMLLabelElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties> style)
 | |
| {
 | |
|     auto layout_node = adopt_ref(*new Layout::Label(document(), this, move(style)));
 | |
|     layout_node->set_inline(true);
 | |
|     return layout_node;
 | |
| }
 | |
| 
 | |
| }
 |