Functional page JavaScript
5.442 KB 2.242 KB gzipAlways loaded.
Browser experiments & working notes
Field notes / six reference scenarios
Inward references, outward connections and shadow-boundary checks.
for="host"#controlPreparing the controls…
Automatic checks for the native property. Force fallback loads the selected adapters. Browser alone leaves them out.
01 / Inward reference
A label names a component by ID; the component selects its internal checkbox.
Try: Click the label, then the checkbox.
02 / Inward reference
The outside button’s popovertarget points to a host, which selects its internal panel.
The button outside this shadow root opened this panel.
Try: Open the note. Dismiss it with Escape or Close.
03 / Inward name reference
The input references a label component. Its designated text is separate from the rest of its content.
Additional component help is not part of the selected name.
Check: Inspect the input’s accessible name. The intended text is “Delivery preference.”
04 / Boundary: attributes stay put
This host has aria-label="Host-only accessible name". Its inner button has its own visible text.
Check: The inner button keeps its own text and has no aria-label.
05 / Boundary: outward string references
The host points to an outside popover. One inner button has no target attribute; another uses the outside ID as a string.
The two buttons in this negative case should not open this panel.
Try: Neither button should open the panel, in any mode.
06 / Explicit outward connection
Here the component’s script assigns the outside popover to its inner button’s popoverTargetElement.
The inner button received this element directly from its component’s script.
Try: Open the outside panel with fallback off. This uses native element reflection.
Always loaded.
Core + selected adapters.
Always-loaded and fallback files; shared files counted once.
Minified / gzip. 1 KB = 1,000 bytes. Demo-only syntax highlighting is excluded from the functional totals and reported separately below.
Generated markup, including these measurements.
Styles, icon, and the highlighting scheduler; functional JS is separate above.
Document + functional fallback path + initial supporting assets, with unique files counted once.
Engine, theme, and this page’s grammar closure, requested after a source disclosure opens or during idle time.
“Local transfer” matches the included development server: gzip JavaScript sidecars, but uncompressed HTML, CSS, and SVG. GitHub Pages, browser caching, HTTP headers, and production compression can change transferred bytes and request scheduling. Module preloads fetch functional modules early without evaluating the app and do not add duplicate transfers.
Selected adapters: labels, popover-targets, text-names.
Gzip totals sum each compressed file. The fallback and native-probe routes are mutually exclusive. Separate CSS files, HTML, JSON, source maps, HTTP headers, and Microlighter assets are excluded. Component styles embedded in JavaScript are included. Transfer sizes depend on compression and caching. Microlighter MIT license.
| File | Delivery | Minified | Gzip |
|---|---|---|---|
scenarios/main.js |
Page | 1.854 KB | 0.880 KB |
shared/chunks/app-S3BP47PD.js |
Page | 3.446 KB | 1.224 KB |
shared/chunks/chunk-S2QLMWTP.js |
Page | 0.142 KB | 0.138 KB |
shared/chunks/reference-target.setup-63HUVE2L.js |
Fallback additional | 29.693 KB | 10.083 KB |
Label activation does not create native .control or .labels links. Naming uses component-provided text. The panel examples require the browser’s Popover API.
These adapters approximate selected relationships. DOM observations do not report computed accessible names or certify accessibility behavior.
Automatic checks for the native property; Browser alone loads no fallback. Test keyboard and assistive-technology behavior separately.
Each shadow root here comes from a real, parser-created <template shadowrootmode="open">. A browser that ignores shadowrootreferencetarget consumes the template anyway. The matching data-reference-target on its host preserves that ID for the fallback’s hydrate(document) call.
<rt-scenario-checkbox id="checkbox-host"
data-reference-target="control">
<template shadowrootmode="open"
shadowrootreferencetarget="control">
<input id="control" type="checkbox">
</template>
</rt-scenario-checkbox>
The label component also publishes data-label-text. Only that component opts into the text adapter; the callback reads the host’s public text value instead of looking inside its shadow root.
textNames({
getText(host, kind) {
if (host.localName !== 'rt-scenario-label' || kind !== 'label') {
return null;
}
return host.getAttribute('data-label-text');
},
});
The outward example uses ordinary component wiring, with no fallback calls:
const button = this.shadowRoot.getElementById('button');
const panel = document.getElementById(this.getAttribute('popovertarget'));
button.popoverTargetElement = panel;