From 504aef470a27aa2cb8473a17ba0a63c6ffe5b887 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 29 Nov 2023 23:41:23 +0100 Subject: [PATCH] LibWeb: Restore painter state if push_stacking_context() has failed If `SkipStackingContext` is returned we also need to restore saved painter state because corresponding pop_stacking_context command that is supposed to do that will be skipped. Fixes https://github.com/SerenityOS/serenity/issues/22092 --- .../Libraries/LibWeb/Painting/PaintingCommandExecutorCPU.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorCPU.cpp b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorCPU.cpp index fd020aef63..884e070a94 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/PaintingCommandExecutorCPU.cpp @@ -166,6 +166,7 @@ CommandResult PaintingCommandExecutorCPU::push_stacking_context( // with execution of commands outside of this stacking context. // FIXME: Change the get_region_bitmap() API to return ErrorOr> and exit the execution of commands here // if we run out of memory. + painter().restore(); return CommandResult::SkipStackingContext; }