1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

LibWeb: Allow specifying a URL for an SVG fill

This does not do anything yet, but will allow for gradients later!
This commit is contained in:
MacDue 2023-04-21 18:31:00 +01:00 committed by Andreas Kling
parent 2fbe5b969b
commit a5fa5e55ef
4 changed files with 25 additions and 1 deletions

View file

@ -519,6 +519,12 @@ bool property_accepts_value(PropertyID property_id, StyleValue& style_value)
output_numeric_value_check(property_generator, "is_time"sv, "as_time().time().to_seconds()"sv, Array { "Time"sv }, min_value, max_value);
} else if (type_name == "url") {
// FIXME: Handle urls!
} else if (type_name == "paint") {
// https://svgwg.org/svg2-draft/painting.html#SpecifyingPaint
property_generator.append(R"~~~(
if (style_value.has_color() || style_value.is_url())
return true;
)~~~");
} else {
// Assume that any other type names are defined in Enums.json.
// If they're not, the output won't compile, but that's fine since it's invalid.