1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:17:35 +00:00

LibWeb: Establish a stacking context for root element

Until now we were just creating a stacking context for the tree root,
which usually is the viewport element. This lead to weird painting
behaviour when negative z-index children of the html element that
established their own stacking context were drawn below the canvas
background.

Now we establish a stacking context for both, the root element and the
viewport.
This commit is contained in:
Mathis Wiehl 2023-03-11 17:17:17 +01:00 committed by Linus Groh
parent 08c1effc04
commit dd81a975d7

View file

@ -117,7 +117,7 @@ bool Node::establishes_stacking_context() const
if (!has_style())
return false;
if (dom_node() == &document().root())
if (is_root_element() || dom_node() == &document().root())
return true;
auto position = computed_values().position();