FIELD NOTES · SEARCH EVIDENCE

Source text is not enough: verify web-component slot projection

AI-assisted original teaching exercise. Names, service text and all six cases are synthetic. The new fixture changes no existing component, navigation, enquiry form or customer page.

The paragraph exists, but the customer cannot see it

A supplier wraps a public service description in a custom element. Searching the initial source finds the paragraph; the component on screen shows only its decorative shell. That is a concrete content-delivery question: which supplied child nodes actually reach the composed presentation after the shadow root is attached?

Google documents support for web components and describes flattening shadow and light DOM when rendering. Its guidance calls for inspecting the rendered HTML rather than assuming source text remains visible. This does not mean every component is broken, or that an ordinary browser is a substitute for a Google rendered capture.

Use a controlled pair before changing the framework

Open the new fixture and compare A with B. Both contain their intended paragraph in light DOM. A has a default slot; B creates a shadow root with no slot. B deliberately retains the source paragraph while failing to project it. A search for the marker in host.textContent therefore answers a different question from observing the displayed component. Keep the failed state in the handover.

The component script is small and readable. It attaches an open root, adds a shell and, where specified, creates slot elements. It performs no fetch, account operation or submission. Its only loaded dependency is the sibling script requested by the browser. It neither copies a Google renderer nor attempts to recreate its indexing pipeline.

A named slot needs an exact relationship

Case C supplies slot=details to name=details. D changes only the child value to detail. The mismatch leaves the intended paragraph unassigned and exposes fallback copy. MDN documents how matching top-level children are assigned, how default slots work and how repeated slot names use the first matching slot. These platform rules make the two cases reproducible without a framework diagnosis.

E supplies no child at all. The fallback is visible, but the reader still lacks an approved service answer. F contains two equally named slots: it does not clone the supplied paragraph into both. Record each slot and its assigned nodes rather than reducing the page to one combined text string. Visible fallback and visible intended content are different acceptance results.

Capture evidence that distinguishes the representations

  1. Record the exact public route, source and script versions, component identity, supplied child text and slot attributes.
  2. In an ordinary browser, inspect the root, each slot name, assigned nodes and fallback, then save the visible presentation at the declared viewport.
  3. Compare the same conditions after an independently authorised correction. Retain the original failure and explain precisely which relationship changed.

For the exercise, an open shadow root makes inspection possible. A generic DOM text search is not a composed-tree test, and finding an assigned node alone does not rule out CSS hiding or a clipping defect. Use the screen as well as the structure. Closed roots, framework hydration, nested components and script failure require additional cases; this fixture does not certify those paths.

Separate a browser correction from a search result

The deliverable is a bounded projection evidence packet. Where authorised tools are available, a later Google rendered-HTML capture should retain its own URL, timestamp and tested version. An ordinary local browser pass does not prove Google indexed the paragraph, improved a keyword position or cited it in an AI answer. Do not rewrite an old canonical, remove protections or reconfigure the whole site to close this new example.

Six filled projection cases

Synthetic inputs; not client incidents or search measurements. Scroll the table on narrow screens.

Case / inputReview outputMeaning
A · Default slot plus unslotted paragraphPROJECTED_CHILDSlot receives the actual child
B · Shadow root without slot, paragraph remains in light DOMLIGHT_DOM_NOT_PROJECTEDFinding text in source is insufficient
C · Child slot=details matches name=detailsNAMED_CHILD_PROJECTEDRecord exact name and assigned node
D · Child slot=detail; slot name=detailsNAME_MISMATCH_FALLBACKFallback replaces the intended visible copy
E · Named slot has fallback, no child suppliedFALLBACK_IS_NOT_APPROVED_COPYA visible placeholder is not a service answer
F · Two details slots, one matching childFIRST_MATCH_OWNS_CHILDFirst receives it; second falls back

Run the original example

Open the six-case browser fixture · Read fixture.js · Filled inputs and expected decisions · README. The published fixture is an ordinary browser demonstration, not a form test or Google request.

Sources and limits

Google: web components and rendered content · MDN: slot assignment and fallback. Supporting passages checked 7 November 2026. Case labels and the diagnostic procedure are our original teaching choices.

Review direct route entry separately; a correct route can still contain a component whose child text is not projected.