1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

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
This commit is contained in:
Aliaksandr Kalenik 2023-11-29 23:41:23 +01:00 committed by Andreas Kling
parent 2732dd3633
commit 504aef470a

View file

@ -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<Optional<Bitmap>> and exit the execution of commands here
// if we run out of memory.
painter().restore();
return CommandResult::SkipStackingContext;
}