3 ms·
After reading the article, I was more confused than before. The 'shadow' DOM is a 'hidden' space? But it is displayed to the user! And what about this? > Use
by knallfrosch 3y ago
After reading the article, I was more confused than before.
The 'shadow' DOM is a 'hidden' space? But it is displayed to the user!
And what about this?
> Use case and examples: 2. The <video> HTML element where there’re default controls exposed by the browser. We see just a video element in the DOM, but it contains buttons and some other stuff inside its Shadow DOM.
Why do we use Shadow DOM for this? It sounds like something HTML and CSS can do just fine.
- skrebbel 3y agoSure but if you make a video tag, it’s nice that the controls are just there, without having to code them yourself. Shadow DOM is how browser vendors implemented that. They could’ve also said “this is internal magic” but instead they made it a standard so other people can use it too.