mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
LibWeb: Parse descriptors as style values, using the JSON data
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.
This commit is contained in:
parent
60c536bdd5
commit
fd45c53c11
Notes:
github-actions[bot]
2025-04-04 09:42:11 +00:00
Author: https://github.com/AtkinsSJ
Commit: fd45c53c11
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4206
9 changed files with 356 additions and 7 deletions
22
Libraries/LibWeb/CSS/Descriptor.h
Normal file
22
Libraries/LibWeb/CSS/Descriptor.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue