Explain Shadow DOM, encapsulation, and event propagation

Tests Web Components encapsulation and event retargeting. A strong answer covers shadow root/host/boundary, CSS scoping, open versus closed modes, and retargeting where events appear to come from the host element.
Tests Web Components encapsulation beyond frameworks. A great answer defines shadow host, root, and boundary; explains that internal styles do not leak out and external selectors do not pierce in except via inherited properties; distinguishes open and closed modes for JavaScript access; and details event retargeting, where the target is rewritten to the host element when observed from outside. Red flag: calling Shadow DOM a React optimization or iframe alternative.
Read the original → developer.mozilla.org
- #shadow dom
- #web components
- #encapsulation
- #event retargeting
- #browser apis
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.