You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
302
+
303
+
## DOM layers
304
+
WebXR and WebXR Layers are very flexible because they give you complete control over every pixel.
305
+
However, this loses the feature set of HTML which makes it much harder to create 2D UI, provide interactivity and accessible content.
306
+
307
+
To give developers this ability back, this spec will introduce the notion of `DOM Layers`.
308
+
Much like Media and WebGL Layers, these layers are defined as a 2D plane that is composited in the scene by the system Compositor.
309
+
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.
310
+
311
+
To mitigate security concerns the following limitations are applied:
312
+
- The URL has to be same origin as the your session
313
+
- The layer is not allowed to navigate to a different origin
314
+
- The layer is not allowed to create nested context (ie no \<iframe>)
315
+
316
+
Because layer content is only accessible to the system compositor,
317
+
the author will not be able to read any pixel data from the layer
318
+
(just like with media layers).
319
+
320
+
Creating the layer will immediately start its browser session. The session won't be released until the layer's `destroy()` method is called.
321
+
322
+
Hit testing is done according to the `targetRayMode` of the current session. Layers that do not have a `blendTextureSourceAlpha` will block hit testing of DOM layers.
323
+
324
+
To create DOM layers, an XRDOMBinding must be created, similar to the XRWebGLBinding:
@@ -270,6 +274,10 @@ The "[=feature descriptor/layers=]" [=feature descriptor=] has a [=feature requi
270
274
NOTE: This means that executing the {{Permissions/request(permissionDesc)}} API with "[=feature descriptor/layers=]" will
271
275
not enable layers support for the current active session.
272
276
277
+
If an application wants to create [[#domlayer|DOM layers]], the session MUST be requested with an appropriate [=feature descriptor=]. The string "<dfn for="feature descriptor">dom-layers</dfn>" is introduced
278
+
by this module as a new valid [=feature descriptor=] for the WebXR Layers feature.
279
+
280
+
273
281
Layer types {#xrlayertypes}
274
282
===========
275
283
@@ -371,6 +379,7 @@ or a {{WebGL2RenderingContext}} |context|, the user agent MUST run the following
371
379
<dd> Set [=this=]{{XRCompositionLayer/chromaticAberrationCorrection}} to <code>null</code>.
372
380
</dl>
373
381
382
+
374
383
</div>
375
384
376
385
<div class="algorithm" data-algorithm="calling destroy on a layer">
@@ -1840,6 +1849,133 @@ When this method is invoked, the user agent MUST run the following steps:
1840
1849
1841
1850
ISSUE: define how the {{XREquirectLayer}}'s parameters affect the video display.
1842
1851
1852
+
DOM layer creation {#domlayer}
1853
+
==================
1854
+
1855
+
Description {#xrdomlayerdescription}
1856
+
-----------
1857
+
DOM Layers allow the display of HTML content within an immersive session.
1858
+
They are only enabled when the "[=feature descriptor/dom-layers=]" [=feature descriptor=] is granted to the current {{XRSession}}.
1859
+
1860
+
The [=origin=] of the URL MUST be the same as the [=origin=] of the URL that created the immersive session.
1861
+
In addition, the `[=child-src=]` and `[=navigate-to=]` Content Security Policies with the document's [=origin=] MUST be applied to the loaded document.
1862
+
1863
+
NOTE: this means that the experience can only open pages from the same [=origin=] and these pages can't open iframes to other origins or navigate to other origins.
1864
+
1865
+
XRDOMLayerInit {#xrdomlayerinittype}
1866
+
--------------
1867
+
The {{XRDOMLayerInit}} dictionary represents a set of configurable values that describe how an {{XRCompositionLayer}} containing a web page
1868
+
is initialized.
1869
+
1870
+
<pre class="idl">
1871
+
dictionary XRDOMLayerInit {
1872
+
required XRSpace space;
1873
+
XRRigidTransform? transform;
1874
+
};
1875
+
</pre>
1876
+
1877
+
The <dfn dict-member for="XRDOMLayerInit">space</dfn> attribute defines the spatial relationship with the user’s physical environment.
1878
+
1879
+
XRDOMQuadLayerInit {#xrdomquadlayerinittype}
1880
+
------------------
1881
+
The {{XRDOMQuadLayerInit}} dictionary represents a set of configurable values that describe how an {{XRQuadLayer}} containing a web page
The <dfn method for="XRDOMBinding">createQuadLayer(DOMString |url|, XRQuadLayerInit |init|)</dfn> method creates a new {{XRDOMQuadLayerResult}} |result|.
1961
+
1962
+
When this method is invoked, the user agent MUST run the following steps:
The <dfn method for="XRDOMBinding">createCylinderLayer(DOMString |url|, XRDOMCylinderLayerInit |init|)</dfn> method creates a new {{XRDOMCylinderLayerResult}} |result|.
1971
+
1972
+
When this method is invoked, the user agent MUST run the following steps:
1973
+
1. |url|
1974
+
1. |init|
1975
+
1. |result|
1976
+
1977
+
</div>
1978
+
1843
1979
Events {#events}
1844
1980
======
1845
1981
@@ -1939,7 +2075,7 @@ monoscopic devices.
1939
2075
1940
2076
XRView changes {#xrviewchanges}
1941
2077
--------------
1942
-
Each [=view=] MUST define a <dfn ignore=''>recommended WebGL texture resolution</dfn> which represents a best estimate of the WebGL texture
2078
+
Each [=view=] MUST define a <dfn>recommended WebGL texture resolution</dfn> which represents a best estimate of the WebGL texture
0 commit comments