LibWeb/SVG: Parse mask attribute as the mask CSS property

We now have support for the various mask longhands so we no longer need
this hack.
This commit is contained in:
Sam Atkins 2025-11-13 12:58:26 +00:00
parent d61791e6e8
commit fd559341e3
Notes: github-actions[bot] 2025-11-14 09:56:47 +00:00

View file

@ -135,12 +135,8 @@ void SVGElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties> cas
if (!property.supported_elements.is_empty() && !property.supported_elements.contains_slow(local_name()))
continue;
if (property.id == CSS::PropertyID::Mask) {
// Mask is a shorthand property in CSS, but parse_css_value does not take that into account. For now,
// just parse as 'mask-image' as anything else is currently not supported.
// FIXME: properly parse longhand 'mask' property
if (auto style_value = parse_css_value(parsing_context, value, CSS::PropertyID::MaskImage)) {
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::MaskImage, style_value.release_nonnull());
}
if (auto style_value = parse_css_value(parsing_context, value, CSS::PropertyID::Mask))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Mask, style_value.release_nonnull());
} else {
if (auto style_value = parse_css_value(parsing_context, value, property.id))
cascaded_properties->set_property_from_presentational_hint(property.id, style_value.release_nonnull());