mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Fail less when multiple mask images are defined
We don't yet support multiple images but we at least continue to use the first rather than having none
This commit is contained in:
parent
5371862d11
commit
1a5933cb04
Notes:
github-actions[bot]
2025-12-01 10:19:11 +00:00
Author: https://github.com/Calme1709
Commit: 1a5933cb04
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6972
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 32 additions and 1 deletions
|
|
@ -787,7 +787,15 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
|
|||
computed_values.set_shape_rendering(computed_style.shape_rendering());
|
||||
computed_values.set_paint_order(computed_style.paint_order());
|
||||
|
||||
auto const& mask_image = computed_style.property(CSS::PropertyID::MaskImage);
|
||||
// FIXME: We should actually support more than one mask image rather than just using the first
|
||||
auto const& mask_image = [&] -> CSS::StyleValue const& {
|
||||
auto const& value = computed_style.property(CSS::PropertyID::MaskImage);
|
||||
|
||||
if (value.is_value_list())
|
||||
return value.as_value_list().values()[0];
|
||||
|
||||
return value;
|
||||
}();
|
||||
if (mask_image.is_url()) {
|
||||
computed_values.set_mask(mask_image.as_url().url());
|
||||
} else if (mask_image.is_abstract_image()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue