File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -787,7 +787,15 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style)
787787 computed_values.set_shape_rendering (computed_style.shape_rendering ());
788788 computed_values.set_paint_order (computed_style.paint_order ());
789789
790- auto const & mask_image = computed_style.property (CSS::PropertyID::MaskImage);
790+ // FIXME: We should actually support more than one mask image rather than just using the first
791+ auto const & mask_image = [&] -> CSS::StyleValue const & {
792+ auto const & value = computed_style.property (CSS::PropertyID::MaskImage);
793+
794+ if (value.is_value_list ())
795+ return value.as_value_list ().values ()[0 ];
796+
797+ return value;
798+ }();
791799 if (mask_image.is_url ()) {
792800 computed_values.set_mask (mask_image.as_url ().url ());
793801 } else if (mask_image.is_abstract_image ()) {
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < style >
3+ # mask-image-box {
4+ background-color : green;
5+ width : 100px ;
6+ height : 100px ;
7+ }
8+ </ style >
9+ < div id ="mask-image-box "> </ div >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < link rel ="match " href ="../expected/mask-image-multiple-same-ref.html " />
3+ < style >
4+ # mask-image-box {
5+ background-color : green;
6+ width : 100px ;
7+ height : 200px ;
8+ mask-image : url ("../data/mask-image-100x200.png" ), url ("../data/mask-image-100x200.png" );
9+ }
10+ </ style >
11+
12+ < div id ="mask-image-box "> </ div >
13+ <!-- FIXME: Workaround to ensure CSS mask-image is loaded before taking screenshot: https://github.com/LadybirdBrowser/ladybird/issues/3448 -->
14+ < img style ="display: none " src ="../data/mask-image-100x200.png " />
You can’t perform that action at this time.
0 commit comments