This API would be a really nice way to do UI in WebXR especially in conjuction WebXR Layers, however currently element images aren't getting updated during an immersive session.
After doing a couple of quick tests, it seems like the paint event doesn't fire during immersive XR sessions, unless the page is also visible (e.g. in an emulator or by bringing it up via Oculus menu on a real device). Presumably, it happens because DOM doesn't go through the regular rendering process (window.requestAnimationFrame has the same limitation). However when using snapdom as an alternative, updating elements on the page does lead to them being redrawn as expected.
This API would be a really nice way to do UI in WebXR especially in conjuction WebXR Layers, however currently element images aren't getting updated during an immersive session.
After doing a couple of quick tests, it seems like the
paintevent doesn't fire during immersive XR sessions, unless the page is also visible (e.g. in an emulator or by bringing it up via Oculus menu on a real device). Presumably, it happens because DOM doesn't go through the regular rendering process (window.requestAnimationFramehas the same limitation). However when using snapdom as an alternative, updating elements on the page does lead to them being redrawn as expected.