mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb/CSS: Add String->ValueType conversion function
And also move this out of PropertyID.h because it's a separate thing. I considered generating this but there's really not much to it.
This commit is contained in:
parent
0c66adfa1a
commit
08bf9d39de
Notes:
github-actions[bot]
2025-07-16 13:49:40 +00:00
Author: https://github.com/AtkinsSJ
Commit: 08bf9d39de
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5400
Reviewed-by: https://github.com/tcl3 ✅
4 changed files with 112 additions and 47 deletions
|
@ -165,6 +165,7 @@ ErrorOr<void> generate_header_file(JsonObject& properties, JsonObject& logical_p
|
|||
#include <AK/Variant.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/CSS/Enums.h>
|
||||
#include <LibWeb/CSS/ValueType.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -255,33 +256,6 @@ Optional<PropertyID> property_id_from_string(StringView);
|
|||
bool is_inherited_property(PropertyID);
|
||||
NonnullRefPtr<CSSStyleValue const> property_initial_value(PropertyID);
|
||||
|
||||
enum class ValueType {
|
||||
Angle,
|
||||
BackgroundPosition,
|
||||
BasicShape,
|
||||
Color,
|
||||
Counter,
|
||||
CustomIdent,
|
||||
EasingFunction,
|
||||
FilterValueList,
|
||||
FitContent,
|
||||
Flex,
|
||||
Frequency,
|
||||
Image,
|
||||
Integer,
|
||||
Length,
|
||||
Number,
|
||||
OpenTypeTag,
|
||||
Paint,
|
||||
Percentage,
|
||||
Position,
|
||||
Ratio,
|
||||
Rect,
|
||||
Resolution,
|
||||
String,
|
||||
Time,
|
||||
Url,
|
||||
};
|
||||
bool property_accepts_type(PropertyID, ValueType);
|
||||
bool property_accepts_keyword(PropertyID, Keyword);
|
||||
Optional<ValueType> property_resolves_percentages_relative_to(PropertyID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue