mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 21:30:58 +00:00 
			
		
		
		
	 fd45c53c11
			
		
	
	
		fd45c53c11
		
	
	
	
	
		
			
			The goal here is to do something a bit smarter with the parsing here than we do for properties. Instead of the JSON saying "here are the values, and here are the keywords, and we can have up to 3", here we place the syntax in the JSON directly (though currently broken up as one string per option) and then we attempt to parse each one in sequence. It's something we'll need eventually for `@property` among other things. ...However, in this first pass, I've gone with the simplest option of hard-coding the types instead of figuring them out properly. So there's a PositivePercentage type and a UnicodeRangeTokens type, instead of properly implementing the grammar for those in a generic way.
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			361 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			361 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/NonnullRefPtr.h>
 | |
| #include <LibWeb/CSS/DescriptorID.h>
 | |
| #include <LibWeb/Forward.h>
 | |
| 
 | |
| namespace Web::CSS {
 | |
| 
 | |
| struct Descriptor {
 | |
|     ~Descriptor();
 | |
| 
 | |
|     DescriptorID descriptor_id;
 | |
|     NonnullRefPtr<CSSStyleValue const> value;
 | |
| };
 | |
| 
 | |
| }
 |