| 
									
										
										
										
											2019-06-20 23:25:25 +02:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/AKString.h>
 | 
					
						
							|  |  |  | #include <AK/Vector.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-29 17:32:32 +02:00
										 |  |  | #include <LibHTML/CSS/Specificity.h>
 | 
					
						
							| 
									
										
										
										
											2019-06-20 23:25:25 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class Selector { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     struct Component { | 
					
						
							| 
									
										
										
										
											2019-06-29 17:32:32 +02:00
										 |  |  |         enum class Type { | 
					
						
							|  |  |  |             Invalid, | 
					
						
							|  |  |  |             TagName, | 
					
						
							|  |  |  |             Id, | 
					
						
							|  |  |  |             Class | 
					
						
							|  |  |  |         }; | 
					
						
							| 
									
										
										
										
											2019-06-20 23:25:25 +02:00
										 |  |  |         Type type { Type::Invalid }; | 
					
						
							|  |  |  |         String value; | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-22 09:27:39 +02:00
										 |  |  |     explicit Selector(Vector<Component>&&); | 
					
						
							|  |  |  |     ~Selector(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-20 23:25:25 +02:00
										 |  |  |     const Vector<Component>& components() const { return m_components; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-29 17:32:32 +02:00
										 |  |  |     Specificity specificity() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-20 23:25:25 +02:00
										 |  |  | private: | 
					
						
							|  |  |  |     Vector<Component> m_components; | 
					
						
							|  |  |  | }; |