LibWeb: Create stacking context for flex/grid items with z-index != auto

This commit is contained in:
Andreas Kling 2022-09-13 19:51:47 +02:00
parent fb5879fdcc
commit f941b7aefe
Notes: sideshowbarker 2024-07-17 07:11:12 +09:00

View file

@ -89,6 +89,15 @@ bool Node::establishes_stacking_context() const
return true;
if (!computed_values().transformations().is_empty())
return true;
// Element that is a child of a flex container, with z-index value other than auto.
if (parent() && parent()->computed_values().display().is_flex_inside() && computed_values().z_index().has_value())
return true;
// Element that is a child of a grid container, with z-index value other than auto.
if (parent() && parent()->computed_values().display().is_grid_inside() && computed_values().z_index().has_value())
return true;
return computed_values().opacity() < 1.0f;
}