| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2025, Tim Ledbetter <tim.ledbetter@ladybird.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  | #include <LibWeb/CSS/StyleValues/StyleValue.h>
 | 
					
						
							| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class BorderImageSliceStyleValue final : public StyleValueWithDefaultOperators<BorderImageSliceStyleValue> { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |     static ValueComparingNonnullRefPtr<BorderImageSliceStyleValue const> create(ValueComparingNonnullRefPtr<StyleValue const> top, ValueComparingNonnullRefPtr<StyleValue const> right, ValueComparingNonnullRefPtr<StyleValue const> bottom, ValueComparingNonnullRefPtr<StyleValue const> left, bool fill) | 
					
						
							| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         return adopt_ref(*new (nothrow) BorderImageSliceStyleValue(top, right, bottom, left, fill)); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual ~BorderImageSliceStyleValue() override = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |     ValueComparingNonnullRefPtr<StyleValue const> top() const { return m_properties.top; } | 
					
						
							|  |  |  |     ValueComparingNonnullRefPtr<StyleValue const> left() const { return m_properties.left; } | 
					
						
							|  |  |  |     ValueComparingNonnullRefPtr<StyleValue const> bottom() const { return m_properties.bottom; } | 
					
						
							|  |  |  |     ValueComparingNonnullRefPtr<StyleValue const> right() const { return m_properties.right; } | 
					
						
							| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     bool fill() const { return m_properties.fill; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual String to_string(SerializationMode) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool properties_equal(BorderImageSliceStyleValue const& other) const { return m_properties == other.m_properties; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |     BorderImageSliceStyleValue(ValueComparingNonnullRefPtr<StyleValue const> top, ValueComparingNonnullRefPtr<StyleValue const> right, ValueComparingNonnullRefPtr<StyleValue const> bottom, ValueComparingNonnullRefPtr<StyleValue const> left, bool fill) | 
					
						
							| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  |         : StyleValueWithDefaultOperators(Type::BorderImageSlice) | 
					
						
							|  |  |  |         , m_properties { .top = move(top), .right = move(right), .bottom = move(bottom), .left = move(left), .fill = fill } | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     struct Properties { | 
					
						
							| 
									
										
										
										
											2025-08-08 10:11:51 +01:00
										 |  |  |         ValueComparingNonnullRefPtr<StyleValue const> top; | 
					
						
							|  |  |  |         ValueComparingNonnullRefPtr<StyleValue const> right; | 
					
						
							|  |  |  |         ValueComparingNonnullRefPtr<StyleValue const> bottom; | 
					
						
							|  |  |  |         ValueComparingNonnullRefPtr<StyleValue const> left; | 
					
						
							| 
									
										
										
										
											2025-06-10 16:58:54 +01:00
										 |  |  |         bool fill; | 
					
						
							|  |  |  |         bool operator==(Properties const&) const = default; | 
					
						
							|  |  |  |     } m_properties; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |