Skip to content

Commit 79c80e8

Browse files
committed
Define how feature requirements are satisfied
Fixes #790. Defines more precisely what level of confidence a UA must have that a feature can be supported by a given XR device before creating a session that requires said feature.
1 parent 5834078 commit 79c80e8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

index.bs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,9 @@ When this method is invoked, the user agent MUST run the following steps:
313313
1. Check if an [=immersive session request is allowed=], and if not [=reject=] |promise| with a "{{SecurityError}}" {{DOMException}} and return |promise|.
314314
1. If [=pending immersive session=] is <code>true</code> or [=active immersive session=] is not <code>null</code>, [=reject=] |promise| with an "{{InvalidStateError}}" {{DOMException}} and return |promise|.
315315
1. Set [=pending immersive session=] to <code>true</code>.
316-
</dd>
317-
<dt>Otherwise</dt>
318-
<dd>Check if an [=inline session request is allowed=], and if not [=reject=] |promise| with a "{{SecurityError}}" {{DOMException}} and return |promise|.</dd>
316+
</dd>
317+
<dt>Otherwise</dt>
318+
<dd>Check if an [=inline session request is allowed=], and if not [=reject=] |promise| with a "{{SecurityError}}" {{DOMException}} and return |promise|.</dd>
319319
</dl>
320320
1. Run the following steps [=in parallel=]:
321321
1. Choose |device| based on the following:
@@ -471,6 +471,10 @@ Some [=feature descriptors=], when present in the [=requested features=] list, r
471471

472472
Note: {{XRReferenceSpaceType/"local"}} is always included in the [=requested features=] of [=immersive sessions=] as a [=default feature=], and as such [=immersive sessions=] always need to obtain [=explicit consent=] or [=implicit consent=].
473473

474+
[=Requested features=] can only be enabled for a session if the [=XRSession/XR Device=] is <dfn>capable of supporting</dfn> the feature, which means that the feature is known to be supported by the [=XRSession/XR Device=] in some configurations, even if the current configuration has not yet been verified as supporting the feature. The user agent MAY apply more rigorous constraints if desired in order to yield a more consistent user experience.
475+
476+
Note: For example, several VR devices support either configuring a safe boundary for the user to move around within or skipping boundary configuration and operating in a mode where the user is expected to stand in place. Such a device can be considered to be [=capable of supporting=] {{"bounded-floor"}} {{XRReferenceSpace}}s even if they are currently not configured with safety boundaries, because it's expected that the user could configure the device appropriately if the experience required it. This is to allow user agents to avoid fully initializing the [=XRSession/XR Device=] or waiting for the user's environment to be recognized prior to [=resolve the requested features|resolving the requested features=] if desired. If, however, the user agent knows that the boundary state at the time the session is requested without additional initialization it may choose to reject the {{"bounded-floor"}} feature if the safety boundary not already configured.
477+
474478
<div class="algorithm" data-algorithm="resolve-features">
475479

476480
To <dfn>resolve the requested features</dfn> given |requiredFeatures| and |optionalFeatures| for an {{XRSession}} |session|, the user agent MUST run the following steps:
@@ -479,17 +483,17 @@ To <dfn>resolve the requested features</dfn> given |requiredFeatures| and |optio
479483
1. Let |consentOptional| be an empty [=/list=] of {{DOMString}}.
480484
1. For each |feature| in |requiredFeatures| perform the following steps:
481485
1. If |feature| is not a valid [=feature descriptor=], return <code>false</code>.
482-
1. If the functionality described by |feature| is not supported by |session|'s [=XRSession/XR Device=] or the user agent has otherwise determined to reject the feature, return <code>false</code>.
486+
1. If |session|'s [=XRSession/XR Device=] is not [=capable of supporting=] the functionality described by |feature| or the user agent has otherwise determined to reject the feature, return <code>false</code>.
483487
1. If the functionality described by |feature| requires [=explicit consent=], append it to |consentRequired|.
484488
1. Else append |feature| to |session|'s [=list of enabled features=].
485489
1. For each |feature| in |optionalFeatures| perform the following steps:
486490
1. If |feature| is not a valid [=feature descriptor=], continue to the next entry.
487-
1. If the functionality described by |feature| is not supported by |session|'s [=XRSession/XR Device=] or the user agent has otherwise determined to reject the feature, continue to the next entry.
491+
1. If |session|'s [=XRSession/XR Device=] is not [=capable of supporting=] the functionality described by |feature| or the user agent has otherwise determined to reject the feature, continue to the next entry.
488492
1. If the functionality described by |feature| requires [=explicit consent=], append it to |consentOptional|.
489493
1. Else append |feature| to |session|'s [=list of enabled features=].
490494
1. For each |feature| in the [=default features=] table perform the following steps:
491495
1. If |session|'s [=XRSession/mode=] is not one of the modes associated with |feature| in the [=default features=], continue to the next entry.
492-
1. If the functionality described by |feature| is not supported by |session|'s [=XRSession/XR Device=] or the user agent has otherwise determined to reject the feature, continue to the next entry.
496+
1. If |session|'s [=XRSession/XR Device=] is not [=capable of supporting=] the functionality described by |feature| or the user agent has otherwise determined to reject the feature, continue to the next entry.
493497
1. Else append |feature| to |session|'s [=list of enabled features=].
494498
1. If |consentRequired| or |consentOptional| are not empty, request [=explicit consent=] to use the functionality described by those features.
495499
1. For each |feature| in |consentRequired| perform the following steps:

0 commit comments

Comments
 (0)