Absolute positioning resolves through the flattened tree

Expected: the badge sits in the top-right corner of the host box. The host is the nearest positioned ancestor in the flattened tree, so the shadow tree's absolutely positioned child is placed against it — the shadow boundary does not create a containing block of its own.

Slotted content is positioned by its flattened-tree ancestors

Expected: the light-DOM badge lands in the bottom-left corner of the green shadow panel, not of the page — its containing block is the positioned element inside the shadow tree, because that is its ancestor in the flattened tree.

light badge

The host clips its shadow tree

Expected: the tall striped block inside the shadow tree is cut off at the host's 60px height — overflow: hidden on the host clips shadow content exactly as it would clip light-DOM children.

Stacking contexts are not escapable

Expected: the yellow document layer (z-index: 5) paints over the blue shadow layer, even though the shadow layer asks for z-index: 999. The host establishes a stacking context with z-index: 1, and its descendants are trapped inside it.

document layer, z-index: 5 — must be ON TOP