From 5fe987b12308b2e14f0e5c298b1c8f1db20ce55e Mon Sep 17 00:00:00 2001 From: Rik Cabanier Date: Mon, 10 May 2021 14:00:21 -0700 Subject: [PATCH 1/3] First pass at support for DOM layers --- explainer.md | 35 + webxrlayers-1.bs | 137 ++ webxrlayers-1.html | 5743 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 5915 insertions(+) create mode 100644 webxrlayers-1.html diff --git a/explainer.md b/explainer.md index b048e33..5a84dc0 100644 --- a/explainer.md +++ b/explainer.md @@ -304,3 +304,38 @@ const layer = xrMediaBinding.createQuadLayer(video, { layout: 'stereo-top-bottom ``` This will then cause only the top half of the video to show to the left eye and the bottom half of the video to show to the right eye. If more complex layouts are required than are described by the `XRLayerLayout` enum then the video must be manually rendered using an `XRWebGLBinding` layer instead. + +## DOM layers +WebXR and WebXR Layers are very flexible because they give you complete control over every pixel. +However, this loses the feature set of HTML which makes it much harder to create 2D UI, provide interactivity and accessible content. + +To give developers this ability back, this spec will introduce the notion of `DOM Layers`. +Much like Media and WebGL Layers, these layers are defined as a 2D plane that is composited in the scene by the system Compositor. +However, the content of this layer will be drawn by the browser itself as if it was another browser window. You pass a URL to the layer creation function and the layer will be drawn as if it was a popup window. + +To mitigate security concerns the following limitations are applied: +- The URL has to be same origin as the your session +- The layer is not allowed to navigate to a different origin +- The layer is not allowed to create nested context (ie no \