mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Apply z-index only to positioned elements
`z-index` values other than `auto` also apply to grid and flex items because they behave as if their `position` were `relative`.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
e5dab9e1c7
commit
d9079d2078
Notes:
github-actions[bot]
2026-04-03 21:29:40 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/d9079d20785 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8757 Reviewed-by: https://github.com/gmta ✅
@@ -65,7 +65,7 @@ void ViewportPaintable::build_stacking_context_tree()
|
||||
paintable_box.invalidate_stacking_context();
|
||||
auto* parent_context = paintable_box.enclosing_stacking_context();
|
||||
auto establishes_stacking_context = paintable_box.layout_node().establishes_stacking_context();
|
||||
if ((paintable_box.is_positioned() || establishes_stacking_context) && paintable_box.computed_values().z_index().value_or(0) == 0)
|
||||
if ((paintable_box.is_positioned() || establishes_stacking_context) && paintable_box.effective_z_index().value_or(0) == 0)
|
||||
parent_context->m_positioned_descendants_and_stacking_contexts_with_stack_level_0.append(paintable_box);
|
||||
if (!paintable_box.is_positioned() && paintable_box.is_floating())
|
||||
parent_context->m_non_positioned_floating_descendants.append(paintable_box);
|
||||
|
||||
Reference in New Issue
Block a user