mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
The stacking context tree rebuild had an optimization that skipped rebuilding when a property changed between two values that both create stacking contexts. This is correct for most properties (e.g. opacity 0.5 -> 0.8 doesn't change tree structure), but incorrect for z-index. During tree construction, elements with z-index 0/auto are placed in m_positioned_descendants_and_stacking_contexts_with_stack_level_0, while elements with other z-index values are painted from m_children (negative at step 3, positive at step 9 per CSS 2.1 Appendix E). When z-index changed between non-auto values (e.g. 0 -> 10), the optimization skipped the rebuild, leaving the element in the wrong list and causing it to be painted from both step 8 and step 9. This was visible on pages like shopify.com where elements with transition-all would transition z-index, producing a flood of "Painting commands are recorded twice for stacking context" messages.
7.2 KiB
7.2 KiB