Shadow DOM is now marginally less unusable than before---still unusable

“Release Notes for Safari Technology Preview 95”

Safari finally has shadowRoot.delegateFocus which is the next to last major roadblock to shadow dom use. I honestly don’t understand how people could claim that shadowDOM had cross-platform support before—poor and buggy cross-platform focus handling is one of the major reasons why I had to back out all use of the shadow DOM in a recent work project. Shadow DOM just breaks way more than it fixes: focus handling breaks, event handling breaks (event encapsulation means that most third-party scripts, routers, etc. don’t work), and selection handling breaks.

And the selection APIs are still very, very broken because they are still unspecified: there’s no agreement on what to do; every major engine does its own thing.

Which in turn means you can’t really use rich text editing widgets without major bugs and inconsistencies.

I really, truly tried to be all in on web components this year. That turned out to be the worst web dev decision I’ve made in a long long time, mostly thanks to the Shadow DOM. (Custom Elements are usable but much more verbose and boilerplate-y than I’d like.)

Baldur Bjarnason @baldur