// Copyright (c) Meta Platforms, Inc. and affiliates. /** * @file layerHost.ts * @input Uses the layer's intended inline parent element * @output Exports resolveLayerPortalTarget, the corrective portal target * @position Layer utility; used by useLayer to place the popover in the DOM * * SYNC: When modified, update: * - /packages/core/src/Layer/layerHost.test.ts */ /** * Ancestors a layer must not be hosted inside. * * Two overlapping reasons, both verified in Chrome: * * 1. The HTML parser owns server markup. `

` and the heading-ish elements * take phrasing content only, so a block element inside one makes the * parser close the paragraph and reparent the rest — the layer's content * ends up in the page instead of the popover. A nested `` triggers the * same tearing through the adoption agency algorithm. * 2. Interactive ancestors capture the layer's own interactions. A card * hosted inside an `` or `