| 
									
										
										
										
											2023-11-04 13:57:57 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, Matthew Olsson <mattco@serenityos.org>. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/Animations/Animation.h>
 | 
					
						
							| 
									
										
										
										
											2024-08-14 11:10:54 +01:00
										 |  |  | #include <LibWeb/CSS/CSSStyleValue.h>
 | 
					
						
							| 
									
										
										
										
											2023-11-04 13:57:57 -07:00
										 |  |  | #include <LibWeb/CSS/PropertyID.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::CSS { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // https://www.w3.org/TR/css-animations-2/#cssanimation
 | 
					
						
							|  |  |  | class CSSAnimation : public Animations::Animation { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(CSSAnimation, Animations::Animation); | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     GC_DECLARE_ALLOCATOR(CSSAnimation); | 
					
						
							| 
									
										
										
										
											2023-11-04 13:57:57 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     static GC::Ref<CSSAnimation> create(JS::Realm&); | 
					
						
							| 
									
										
										
										
											2023-11-04 13:57:57 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |     FlyString const& animation_name() const { return id(); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-02-02 16:38:09 -07:00
										 |  |  |     virtual Animations::AnimationClass animation_class() const override; | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  |     virtual Optional<int> class_specific_composite_order(GC::Ref<Animations::Animation> other) const override; | 
					
						
							| 
									
										
										
										
											2024-02-02 16:38:09 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-04 13:57:57 -07:00
										 |  |  | private: | 
					
						
							|  |  |  |     explicit CSSAnimation(JS::Realm&); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual bool is_css_animation() const override { return true; } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |