Detached editor attached into a root

The editor is created detached – from a data string, with no source element – so its UI element starts outside the DOM and its body collection has nowhere to mount yet. Clicking Attach inserts the UI into the root picked below, and the editor has to resolve that root on its own the moment floating UI is first shown.

This test deliberately configures no ui.overlayContainer: the point is the auto-resolution, which a configured container would short-circuit. So the overlay layer is expected in the attach target itself.

  1. Click Attach.
  2. Select text to show the balloon toolbar, open Find & Replace for a dialog, and use the block toolbar handle. All of it must appear inside the attach target, styled – never in the light DOM behind it.

In the shadow modes the editor stylesheet is forwarded into the root and disabled in the main document, so anything that mounts outside it renders unstyled and is easy to spot. A closed root only hides host.shadowRoot from outside code, so both shadow modes should behave identically. The root starts empty here, with no editor in it to reach it through, so it is exposed as window.editorDomRoot – the only way into a closed one before you click Attach.

The rect-source-not-in-dom warnings logged before you click Attach are expected: they come from rects measured while the editor UI is still outside the DOM, which is exactly the state this test starts in.

Editor created detached – its body collection is not in the DOM yet.