ladybird/Tests/LibWeb/Ref/expected/block-element-inside-inline-element-ref.html
Jelle Raaijmakers de7ca7b157 LibWeb: Retain display: contents in ancestor stack for continuations
When restructuring inline nodes because of a block element insertion
during the layout tree build, we might end up with a `display: contents`
element in the ancestor stack that is not part of the actual layout
tree, since it's never actually used as a parent for any node. Because
we were only rewinding the ancestor stack with actual new layout nodes,
it became corrupted and layout nodes were added to the wrong parent.

This new logic leaves the ancestor stack intact, only replacing layout
nodes whenever a new one is created.

Fixes the sidebar on https://reddit.com.
Fixes #3590.
2025-02-18 23:31:49 +01:00

24 lines
646 B
HTML

<!DOCTYPE html>
<html>
<body>
<b>foo</b><div><b>bar</b></div>
<hr>
<div><b>foo</b></div><b>bar</b>
<hr>
<b>foo</b><div><b>bar</b></div><b>baz</b>
<hr>
<b>foo<i>bar</i></b><div><b><i>baz</i></b></div><b><i>lorem</i>ipsum</b>
<hr>
<b>foo</b><div><b>bar</b></div><div><b>baz</b></div><b>lorem</b>
<hr>
<b>foo</b><div><b>bar</b></div><b><u>baz</u></b><div><b>lorem</b></div><b>ipsum</b>
<hr>
<div>foo<div><b>bar</b></div></div>
<hr>
<b>foo</b><div><b>bar</b></div><b>baz</b>
<hr>
<span>foo</span><div>bar</div>
<hr>
<b>foo</b><div><b>bar</b></div><b>baz</b>
</body>
</html>