mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb/CSS: Treat 'mask' as a longhand property
Before this change, an element masked with 'mask-image: url(...)' would show the mask, but 'mask: url(...)' would not. On e.g. dialogic.nl it would show white boxes instead of the actual images in the top navigation bar. We still do not support many of the other mask properties, but with this change at least the masks show up in both cases.
This commit is contained in:
parent
4bf197872b
commit
056205aa76
Notes:
github-actions[bot]
2025-03-05 12:11:03 +00:00
Author: https://github.com/pixelspark
Commit: 056205aa76
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3748
Reviewed-by: https://github.com/AtkinsSJ ✅
9 changed files with 127 additions and 86 deletions
|
@ -182,8 +182,17 @@ void SVGGraphicsElement::apply_presentational_hints(GC::Ref<CSS::CascadedPropert
|
|||
for (auto property : attribute_style_properties) {
|
||||
if (!name.equals_ignoring_ascii_case(property.name))
|
||||
continue;
|
||||
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());
|
||||
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());
|
||||
}
|
||||
} 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());
|
||||
}
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue