Skip to content

Commit 3dbaaad

Browse files
Manishearthtoji
authored andcommitted
Provide descriptions for each method (#798)
Provide descriptions for each method
1 parent 9769b78 commit 3dbaaad

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

index.bs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ The user agent <dfn>ensures an immersive XR device is selected</dfn> by running
268268
The <dfn attribute for="XR">ondevicechange</dfn> attribute is an [=Event handler IDL attribute=] for the {{devicechange}} event type.
269269

270270
<div class="algorithm" data-algorithm="supports-session">
271+
The <dfn method for="XR">supportsSession(|mode|)</dfn> method queries if a given |mode| is supported by the user agent and device capabilities.
271272

272-
When the <dfn method for="XR">supportsSession(|mode|)</dfn> method is invoked, it MUST run the following steps:
273+
When this method is invoked, it MUST run the following steps:
273274

274275
1. Let |promise| be [=a new Promise=].
275276
1. If |mode| is {{XRSessionMode/"inline"}}, [=/resolve=] |promise| and return it.
@@ -299,7 +300,9 @@ The {{XR}} object has a <dfn>pending immersive session</dfn> boolean, which MUST
299300

300301
<div class="algorithm" data-algorithm="request-session">
301302

302-
When the <dfn method for="XR">requestSession(|mode|, |options|)</dfn> method is invoked, the user agent MUST run the following steps:
303+
The <dfn method for="XR">requestSession(|mode|, |options|)</dfn> method attempts to initialize an {{XRSession}} for the given |mode| if possible, entering immersive mode if necessary.
304+
305+
When this method is invoked, the user agent MUST run the following steps:
303306

304307
1. Let |promise| be [=a new Promise=].
305308
1. Let |immersive| be <code>true</code> if |mode| is {{XRSessionMode/"immersive-vr"}}, and <code>false</code> otherwise.
@@ -597,9 +600,9 @@ Each {{XRSession}} has a <dfn>minimum near clip plane</dfn> and a <dfn>maximum f
597600

598601
<div class="algorithm" data-algorithm="update-render-state">
599602

600-
The {{XRSession/updateRenderState()}} method queues an update to the [=active render state=] to be applied on the next frame. Unset fields of the {{XRRenderStateInit}} passed to this method will not be changed.
603+
The <dfn method for="XRSession">updateRenderState(|newState|)</dfn> method queues an update to the [=active render state=] to be applied on the next frame. Unset fields of the {{XRRenderStateInit}} |newState| passed to this method will not be changed.
601604

602-
When the <dfn method for="XRSession">updateRenderState(|newState|)</dfn> method is invoked, the user agent MUST run the following steps:
605+
When this method is invoked, the user agent MUST run the following steps:
603606

604607
1. Let |session| be the target {{XRSession}}.
605608
1. If |session|'s [=ended=] value is <code>true</code>, throw an {{InvalidStateError}} and abort these steps.
@@ -641,8 +644,9 @@ When requested, the {{XRSession}} MUST <dfn>apply the pending render state</dfn>
641644
</div>
642645

643646
<div class="algorithm" data-algorithm="request-reference-space">
647+
The <dfn method for="XRSession">requestReferenceSpace(|type|)</dfn> method constructs a new {{XRReferenceSpace}} of a given |type|, if possible.
644648

645-
When the <dfn method for="XRSession">requestReferenceSpace(|type|)</dfn> method is invoked, the user agent MUST run the following steps:
649+
When this method is invoked, the user agent MUST run the following steps:
646650

647651
1. Let |promise| be [=a new Promise=].
648652
1. Run the following steps [=in parallel=]:
@@ -813,7 +817,9 @@ Each {{XRSession}} has a <dfn>list of animation frame callbacks</dfn>, which is
813817

814818
<div class="algorithm" data-algorithm="request-animation-frame">
815819

816-
When the <dfn method for="XRSession">requestAnimationFrame(|callback|)</dfn> method is invoked, the user agent MUST run the following steps:
820+
The <dfn method for="XRSession">requestAnimationFrame(|callback|)</dfn> method queues up |callback| for being run the next time the user agent wishes to run an animation frame for the device.
821+
822+
When this method is invoked, the user agent MUST run the following steps:
817823

818824
1. Let |session| be the target {{XRSession}} object.
819825
1. Increment |session|'s [=animation frame callback identifier=] by one.
@@ -824,7 +830,9 @@ When the <dfn method for="XRSession">requestAnimationFrame(|callback|)</dfn> met
824830

825831
<div class="algorithm" data-algorithm="cancel-animation-frame">
826832

827-
When the <dfn method for="XRSession">cancelAnimationFrame(|handle|)</dfn> method is invoked, the user agent MUST run the following steps:
833+
The <dfn method for="XRSession">cancelAnimationFrame(|handle|)</dfn> method cancels an existing animation frame callback given its [=animation frame callback identifier=] |handle|.
834+
835+
When this method is invoked, the user agent MUST run the following steps:
828836

829837
1. Let |session| be the target {{XRSession}} object.
830838
1. Find the entry in |session|'s [=list of animation frame callbacks=] that is associated with the value |handle|.
@@ -929,7 +937,9 @@ The <dfn attribute for="XRFrame">session</dfn> attribute returns the {{XRSession
929937

930938
<div class="algorithm" data-algorithm="get-viewer-pose">
931939

932-
When the <dfn method for="XRFrame">getViewerPose(|referenceSpace|)</dfn> method is invoked, the user agent MUST run the following steps:
940+
The <dfn method for="XRFrame">getViewerPose(|referenceSpace|)</dfn> method provides the pose of the [=viewer=] relative to |referenceSpace| as an {{XRViewerPose}}, at the time represented by the {{XRFrame}}.
941+
942+
When this method is invoked, the user agent MUST run the following steps:
933943

934944
1. Let |frame| be the target {{XRFrame}}
935945
1. Let |session| be |frame|'s {{XRFrame/session}} object.
@@ -953,7 +963,9 @@ When the <dfn method for="XRFrame">getViewerPose(|referenceSpace|)</dfn> method
953963

954964
<div class="algorithm" data-algorithm="get-pose">
955965

956-
When the <dfn method for="XRFrame">getPose(|space|, |baseSpace|)</dfn> method is invoked, the user agent MUST run the following steps:
966+
The <dfn method for="XRFrame">getPose(|space|, |baseSpace|)</dfn> method provides the pose of |space| relative to |baseSpace| as an {{XRPose}}, at the time represented by the {{XRFrame}}.
967+
968+
When this method is invoked, the user agent MUST run the following steps:
957969

958970
1. Let |frame| be the target {{XRFrame}}
959971
1. Let |pose| be a new {{XRPose}} object.
@@ -1770,8 +1782,9 @@ function onXRSessionStarted(xrSession) {
17701782
To set the [=XR compatible=] boolean after the context has been created, the {{makeXRCompatible()}} method is used.
17711783

17721784
<div class="algorithm" data-algorithm="make-xr-compatible">
1785+
The <dfn method for="WebGLRenderingContextBase">makeXRCompatible()</dfn> method ensures the {{WebGLRenderingContextBase}} is running on a [=compatible graphics adapter=] for the [=XR/immersive XR device=].
17731786

1774-
When the <dfn method for="WebGLRenderingContextBase">makeXRCompatible()</dfn> method is invoked, the user agent MUST run the following steps:
1787+
When this method is invoked, the user agent MUST run the following steps:
17751788

17761789
1. Let |promise| be [=a new Promise=].
17771790
1. Run the following steps [=in parallel=]:

0 commit comments

Comments
 (0)