mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-26 04:22:07 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
	
		
			924 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
	
		
			924 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibWeb/CSS/Flex.h>
 | |
| #include <LibWeb/CSS/StyleValue.h>
 | |
| 
 | |
| namespace Web::CSS {
 | |
| 
 | |
| class FlexStyleValue final : public StyleValueWithDefaultOperators<FlexStyleValue> {
 | |
| public:
 | |
|     static ValueComparingNonnullRefPtr<FlexStyleValue> create(Flex flex)
 | |
|     {
 | |
|         return adopt_ref(*new (nothrow) FlexStyleValue(move(flex)));
 | |
|     }
 | |
|     virtual ~FlexStyleValue() override = default;
 | |
| 
 | |
|     Flex const& flex() const { return m_flex; }
 | |
|     Flex& flex() { return m_flex; }
 | |
| 
 | |
|     virtual String to_string() const override { return m_flex.to_string(); }
 | |
| 
 | |
|     bool properties_equal(FlexStyleValue const& other) const { return m_flex == other.m_flex; }
 | |
| 
 | |
| private:
 | |
|     FlexStyleValue(Flex&& flex)
 | |
|         : StyleValueWithDefaultOperators(Type::Flex)
 | |
|         , m_flex(flex)
 | |
|     {
 | |
|     }
 | |
| 
 | |
|     Flex m_flex;
 | |
| };
 | |
| 
 | |
| }
 | 
