LibWeb: Use separate restore() for each ApplyOpacity display list item

ApplyOpacity internally calls canvas.saveLayer() which requires a
matching canvas.restore() to be called.

Fixes missing header on https://supabase.com/
This commit is contained in:
Aliaksandr Kalenik 2024-12-01 16:10:19 +01:00 committed by Andreas Kling
parent a486c86eee
commit a7bd3704c5
Notes: github-actions[bot] 2024-12-01 15:34:06 +00:00

View file

@ -57,7 +57,7 @@ void SVGSVGPaintable::paint_svg_box(PaintContext& context, PaintableBox const& s
auto const& filter = svg_box.computed_values().filter();
auto masking_area = svg_box.get_masking_area();
auto needs_to_save_state = computed_values.opacity() < 1 || svg_box.has_css_transform() || svg_box.get_masking_area().has_value();
auto needs_to_save_state = svg_box.has_css_transform() || svg_box.get_masking_area().has_value();
if (needs_to_save_state) {
context.display_list_recorder().save();
@ -99,6 +99,10 @@ void SVGSVGPaintable::paint_svg_box(PaintContext& context, PaintableBox const& s
context.display_list_recorder().restore();
}
if (computed_values.opacity() < 1) {
context.display_list_recorder().restore();
}
if (needs_to_save_state) {
context.display_list_recorder().restore();
}