https://security.stackexchange.com/questions/13799/is-webgl-...
TLDR: if js gets direct control of GPU, it can read/modify present and past screens.
Maybe after Wayland implementations get good enough, distributions will make hw acceleration work securely with wayland compositors, probably years? Just guessing.
Playing video on youtube is easy, but performance sucks due to bloated youtube website. Performance of the same video URL in empty page with video player is much better, close to that in video player with CPU only.
If you need GPU acceleration, you can use something like youtube-dl or mpv to play videos on a URL in a video player.