mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibWeb: Generate CSS::{first,last}_property_id constants
These will allow us to iterate through all known CSS properties.
This commit is contained in:
parent
3ca2e701e6
commit
2e4b34b8c3
1 changed files with 13 additions and 0 deletions
|
@ -56,9 +56,16 @@ enum class PropertyID {
|
||||||
Custom,
|
Custom,
|
||||||
)~~~");
|
)~~~");
|
||||||
|
|
||||||
|
Optional<String> first_property_id;
|
||||||
|
Optional<String> last_property_id;
|
||||||
|
|
||||||
json.value().as_object().for_each_member([&](auto& name, auto& value) {
|
json.value().as_object().for_each_member([&](auto& name, auto& value) {
|
||||||
VERIFY(value.is_object());
|
VERIFY(value.is_object());
|
||||||
|
|
||||||
|
if (!first_property_id.has_value())
|
||||||
|
first_property_id = name;
|
||||||
|
last_property_id = name;
|
||||||
|
|
||||||
auto member_generator = generator.fork();
|
auto member_generator = generator.fork();
|
||||||
member_generator.set("name:titlecase", title_casify(name));
|
member_generator.set("name:titlecase", title_casify(name));
|
||||||
|
|
||||||
|
@ -67,6 +74,9 @@ enum class PropertyID {
|
||||||
)~~~");
|
)~~~");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
generator.set("first_property_id", title_casify(first_property_id.value()));
|
||||||
|
generator.set("last_property_id", title_casify(last_property_id.value()));
|
||||||
|
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,6 +86,9 @@ bool is_inherited_property(PropertyID);
|
||||||
bool is_pseudo_property(PropertyID);
|
bool is_pseudo_property(PropertyID);
|
||||||
RefPtr<StyleValue> property_initial_value(PropertyID);
|
RefPtr<StyleValue> property_initial_value(PropertyID);
|
||||||
|
|
||||||
|
constexpr PropertyID first_property_id = PropertyID::@first_property_id@;
|
||||||
|
constexpr PropertyID last_property_id = PropertyID::@last_property_id@;
|
||||||
|
|
||||||
enum class Quirk {
|
enum class Quirk {
|
||||||
// https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
|
// https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
|
||||||
HashlessHexColor,
|
HashlessHexColor,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue