Source

Vanilla in Shadow DOM

sourceRoot determines where Tracker looks for source elements. Rendering location is a separate concern.

Here, an actual open ShadowRoot is the source/query scope, while a separate element inside it owns the rendered rail. Shadow DOM boundaries remain explicit: Tracker does not pierce nested ShadowRoots that were not supplied as sourceRoot.

Compare with the Element scenario, where assigning a ShadowRoot changes the source/query scope but does not move the Element-owned renderer.

Boundary model

Document
└── #shadow-host
    └── open ShadowRoot  ← sourceRoot
        ├── tracked sources
        └── renderHost
            └── Tracker rail
Source/query context
open ShadowRoot
Renderer owner
consumer-provided renderHost
Rail location
inside the same user-managed ShadowRoot
Tracker stylesheet
inside the ShadowRoot styling context

Preparing the open ShadowRoot.