webxr icon indicating copy to clipboard operation
webxr copied to clipboard

Backgrounded Tabs and WebXR

Open AdaRoseCannon opened this issue 1 year ago • 4 comments

The default assumption for WebXR is an external dumb display connected to an external computer which still displays the browser and handles the rendering. When the user enters WebXR the page continues rendering as usual.

/facetoface All-in-one devices such as the Apple Vision Pro and Meta Quest hide the browser to focus rendering resources on the WebXR content. As part of hiding the browser the page itself still has to sort-of run as some content needs to be updated but other content does not update. I don’t think it is specced out anywhere which bits keep running and which bits don’t but to ensure cross compatibility we should establish this somewhere.

Here are some examples of the buckets and examples of things in each:

Things which should keep working:

  • Video
  • Audio
  • gamepad
  • Input elements and associated events

Things which definitely should not work:

  • The page’s rAF

Things that are a maybe:

  • Resize observer
  • The page updating layout??
  • CSS animations and transitions

AdaRoseCannon avatar Mar 12 '24 20:03 AdaRoseCannon

When you say tabs - do you mean the page that opened WebXR or all other pages? This seems most critical for the page that the WebXR user is currently in.

Is running in the background towards the goal of being able to access a webpage in WebXR in the foreground? For example, a webpage running in the background on a PC can do screen capture to put itself on a texture and make itself visible in WebXR. Being able to render in the background is really good.

The best possible situation seems like being able to view it in the foreground in real WebXR. Once we can do that in browsers, I think these background expectation will hold stronger too.

Spec'ing that webpages should still be expected to be able to be fully functional webpages with WebXR is a good expectation to set.

KooIaIa avatar Mar 20 '24 02:03 KooIaIa

Similar previous issue: https://github.com/immersive-web/webxr/issues/1317

m-blix avatar Mar 25 '24 03:03 m-blix

I'd be curious what the relationship is to dom-overlay; it feels like there should be a (specification) relation here.

hybridherbst avatar Apr 02 '24 18:04 hybridherbst

The spec calls some of it out: "An active immersive session MAY affect the rendering opportunity of a browsing context if it causes the page to be obscured." It seems that the link to the whatwg document defines the expected behavior.

Do we need more discussion on this topic?

cabanier avatar Oct 23 '24 18:10 cabanier