mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-30 23:52:43 +00:00 
			
		
		
		
	 85a0772147
			
		
	
	
		85a0772147
		
	
	
	
	
		
			
			Until now, we've internally thought of the CSS "display" property as a single-value property. In practice, "display" is a much more complex property that comes in a number of configurations. The most interesting one is the two-part format that describes the outside and inside behavior of a box. Switching our own internal representation towards this model will allow for much cleaner abstractions around layout and the various formatting contexts. Note that we don't *parse* two-part "display" yet, this is only about changing the internal representation of the property. Spec: https://drafts.csswg.org/css-display
		
			
				
	
	
		
			27 lines
		
	
	
	
		
			690 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
	
		
			690 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <AK/StringBuilder.h>
 | |
| #include <LibWeb/DOM/Document.h>
 | |
| #include <LibWeb/Layout/SVGGraphicsBox.h>
 | |
| #include <LibWeb/SVG/SVGGElement.h>
 | |
| 
 | |
| namespace Web::SVG {
 | |
| 
 | |
| SVGGElement::SVGGElement(DOM::Document& document, QualifiedName qualified_name)
 | |
|     : SVGGraphicsElement(document, move(qualified_name))
 | |
| {
 | |
| }
 | |
| 
 | |
| RefPtr<Layout::Node> SVGGElement::create_layout_node()
 | |
| {
 | |
|     auto style = document().style_computer().compute_style(*this);
 | |
|     if (style->display().is_none())
 | |
|         return nullptr;
 | |
|     return adopt_ref(*new Layout::SVGGraphicsBox(document(), *this, move(style)));
 | |
| }
 | |
| 
 | |
| }
 |