From 61d729ad0ca2514983f7e16d40001c4e043fe230 Mon Sep 17 00:00:00 2001 From: Brandon Jones Date: Mon, 31 Oct 2016 23:46:46 -0700 Subject: [PATCH] Addressed multiple pieces of feedback --- index.bs | 22 ++-- index.html | 366 +++++++++++++++++++++++++---------------------------- 2 files changed, 183 insertions(+), 205 deletions(-) diff --git a/index.bs b/index.bs index 1d6c4324..f08d9792 100644 --- a/index.bs +++ b/index.bs @@ -217,21 +217,21 @@ Captures the current state of the {{VRLayer}} currently being presented and disp ### Events ### {#vrdisplay-events} -User agents implementing this specification MUST provide the following new DOM events. The corresponding events must be of type {{VRDisplayEvent}} and must fire on a {{VRDisplay}} object. Registration for and firing of the events must follow the usual behavior of DOM4 Events. +The UA MUST provide the following new events. The corresponding events must be of type {{VRDisplayEvent}} and must fire on a {{VRDisplay}} object. Registration for and firing of the events must follow the usual behavior of DOM4 Events. -vrdisplayactivate +activate A user agent MAY dispatch this event type to indicate that something has occured which suggests the {{VRDisplay}} should be presented to. For example, if the {{VRDisplay}} is capable of detecting when the user has put it on, this event SHOULD fire when they do so with the reason "mounted". -vrdisplaydeactivate +deactivate A user agent MAY dispatch this event type to indicate that something has occured which suggests the {{VRDisplay}} should exit presentation. For example, if the {{VRDisplay}} is capable of detecting when the user has taken it off, this event SHOULD fire when they do so with the reason "unmounted". -vrdisplayblur +blur A user agent MAY dispatch this event type to indicate that presentation to the display by the page is paused by the user agent, OS, or VR hardware. While a {{VRDisplay}} is blurred it does not lose it's presenting status ({{isPresenting}} continues to report true) but {{getFrameData()}} returns false without updating the provided {{VRFrameData}} and {{getPose()}} returns null. This is to prevent tracking while the user interacts with potentially sensitive UI. For example: A user agent SHOULD blur the presenting application when the user is typing a URL into the browser with a virtual keyboard, otherwise the presenting page may be able to guess the URL the user is entering by tracking their head motions. -vrdisplayfocus +focus A user agent MAY dispatch this event type to indicate that presentation to the display by the page has resumed after being blurred. -vrdisplaypresentchange +presentchange A user agent MUST dispatch this event type to indicate that a {{VRDisplay}} has begun or ended VR presentation. This event should not fire on subsequent calls to {{requestPresent()}} after the {{VRDisplay}} has already begun VR presentation.
@@ -582,7 +582,7 @@ Depth of the play-area bounds in meters. The bounds are defined as an axis-align ## VR Interface ## {#interface-vr}
-interface VR : EventTarget{
+interface VR : EventTarget {
   Promise<sequence<VRDisplay>> getDisplays();
   readonly attribute FrozenArray<VRDisplay> activeDisplays;
   readonly attribute boolean isEnabled;
@@ -602,15 +602,15 @@ The {{isEnabled}} attribute's getter must return true if the context object is a
 
 ### Events ### {#vr-events}
 
-User agents implementing this specification MUST provide the following new DOM events. The corresponding events must be of type {{VRDisplayEvent}} and must fire on the {{vr}} object. Registration for and firing of the events must follow the usual behavior of DOM4 Events.
+The UA MUST provide the following new events. The corresponding events must be of type {{VRDisplayEvent}} and must fire on the {{vr}} object. Registration for and firing of the events must follow the usual behavior of DOM4 Events.
 
-vrdisplayconnect
+displayconnect
 A user agent MAY dispatch this event type to indicate that a {{VRDisplay}} has been connected.
 
-vrdisplaydisconnect
+displaydisconnect
 A user agent MAY dispatch this event type to indicate that a {{VRDisplay}} has been disconnected.
 
-vrdisplaynavigate
+navigate
 A user agent MAY dispatch this event type to indicate that the current page has been navigated to from a page that was actively presenting VR content to the {{VRDisplay}}. The current page can call {{requestPresent()}} in response to this event in order to stay in VR presentation mode.
 
 
diff --git a/index.html b/index.html
index 12f97c3a..eb0565cd 100644
--- a/index.html
+++ b/index.html
@@ -1421,7 +1421,7 @@
   

WebVR

-

Editor’s Draft,

+

Editor’s Draft,

This version: @@ -1435,6 +1435,8 @@

(Mozilla)
Participate:
File an issue (open issues) +
Mailing list archive +
W3C’s #webvr IRC

@@ -1471,6 +1473,7 @@

Table of Contents

2.1 VRDisplay
  1. 2.1.1 Attributes +
  2. 2.1.2 Events
  • 2.2 VRLayer @@ -1505,21 +1508,22 @@

    Table of Contents

  • 2.9.1 Attributes
  • - 2.10 Navigator Interface extension + 2.10 VR Interface
      -
    1. 2.10.1 Attributes +
    2. 2.10.1 Attributes +
    3. 2.10.2 Events
    +
  • 2.11 Navigator Interface extension
  • - 2.11 VRDisplayEventReason + 2.12 VRDisplayEventReason
      -
    1. 2.11.1 Reasons +
    2. 2.12.1 Reasons
  • - 2.12 VRDisplayEvent + 2.13 VRDisplayEvent
      -
    1. 2.12.1 Attributes +
    2. 2.13.1 Attributes
    -
  • 2.13 Window Interface extension
  • 2.14 allowvr iframe attribute
  • 2.15 Gamepad Interface extension @@ -1688,8 +1692,15 @@

    exitPresent() Ends presentation to the VRDisplay and fulfills the returned promise when fully exited. If the VRDisplay is not presenting the promise MUST be rejected.

    getLayers() Returns an array with the VRLayer currently being presented. MUST return an empty array if the VRDisplay is not currently presenting. If the VRDisplay is presenting MUST return an array containing the VRLayers last passed to requestPresent().

    submitFrame() Captures the current state of the VRLayer currently being presented and displays it on the VRDisplay. It is assumed that the frame was rendered using the VRPose and matrices provided by the last call to getFrameData(). If getFrameData() was not called prior to calling submitFrame() the user agent MAY warn the user of potentially malformed visuals or prevent the frame from being shown at all.

    +

    2.1.2. Events

    +

    The UA MUST provide the following new events. The corresponding events must be of type VRDisplayEvent and must fire on a VRDisplay object. Registration for and firing of the events must follow the usual behavior of DOM4 Events.

    +

    activate A user agent MAY dispatch this event type to indicate that something has occured which suggests the VRDisplay should be presented to. For example, if the VRDisplay is capable of detecting when the user has put it on, this event SHOULD fire when they do so with the reason "mounted".

    +

    deactivate A user agent MAY dispatch this event type to indicate that something has occured which suggests the VRDisplay should exit presentation. For example, if the VRDisplay is capable of detecting when the user has taken it off, this event SHOULD fire when they do so with the reason "unmounted".

    +

    blur A user agent MAY dispatch this event type to indicate that presentation to the display by the page is paused by the user agent, OS, or VR hardware. While a VRDisplay is blurred it does not lose it’s presenting status (isPresenting continues to report true) but getFrameData() returns false without updating the provided VRFrameData and getPose() returns null. This is to prevent tracking while the user interacts with potentially sensitive UI. For example: A user agent SHOULD blur the presenting application when the user is typing a URL into the browser with a virtual keyboard, otherwise the presenting page may be able to guess the URL the user is entering by tracking their head motions.

    +

    focus A user agent MAY dispatch this event type to indicate that presentation to the display by the page has resumed after being blurred.

    +

    presentchange A user agent MUST dispatch this event type to indicate that a VRDisplay has begun or ended VR presentation. This event should not fire on subsequent calls to requestPresent() after the VRDisplay has already begun VR presentation.

    - The following code demonstrates presenting a simple rendering loop to a VRDisplay. + The following code demonstrates presenting a simple rendering loop to a VRDisplay.
    var frameData = new VRFrameData();
     
     // Render a single frame of VR data.
    @@ -1725,7 +1736,7 @@ 

    2.2. VRLayer

    -

    The VRLayer interface is provided to a VRDisplay and presented in the HMD.

    +

    The VRLayer interface is provided to a VRDisplay and presented in the HMD.

    typedef (HTMLCanvasElement or
              OffscreenCanvas) VRSource;
     
    @@ -1737,11 +1748,11 @@ 

    2.2.1. Attributes

    -

    source The source attribute defines the canvas whose contents will be presented by the VRDisplay when VRDisplay.submitFrame() is called.

    +

    source The source attribute defines the canvas whose contents will be presented by the VRDisplay when VRDisplay.submitFrame() is called.

    leftBounds The leftBounds attribute contains four values defining the texture bounds within the source canvas to present to the eye in UV space: [0] left offset of the bounds (0.0 - 1.0); [1] top offset of the bounds (0.0 - 1.0); [2] width of the bounds (0.0 - 1.0); [3] height of the bounds (0.0 - 1.0). The leftBounds MUST default to [0.0, 0.0, 0.5, 1.0].

    rightBounds The rightBounds attribute contains four values defining the texture bounds rectangle within the source canvas to present to the eye in UV space: [0] left offset of the bounds (0.0 - 1.0); [1] top offset of the bounds (0.0 - 1.0); [2] width of the bounds (0.0 - 1.0); [3] height of the bounds (0.0 - 1.0). The rightBounds MUST default to [0.5, 0.0, 0.5, 1.0].

    2.3. VRDisplayCapabilities

    -

    The VRDisplayCapabilities interface describes the capabilities of a VRDisplay. These are expected to be static per-device/per-user.

    +

    The VRDisplayCapabilities interface describes the capabilities of a VRDisplay. These are expected to be static per-device/per-user.

    interface VRDisplayCapabilities {
       readonly attribute boolean hasPosition;
       readonly attribute boolean hasOrientation;
    @@ -1751,11 +1762,11 @@ 

    2.3.1. Attributes

    -

    hasPosition The hasPosition attribute MUST return whether the VRDisplay is capable of tracking its position.

    -

    hasOrientation The hasOrientation attribute MUST return whether the VRDisplay is capable of tracking its orientation.

    -

    hasExternalDisplay The hasExternalDisplay attribute MUST return whether the VRDisplay is separate from the device’s primary display. If presenting VR content will obscure other content on the device, this should be false. When false, the application should not attempt to mirror VR content or update non-VR UI because that content will not be visible.

    -

    canPresent The canPresent attribute MUST return whether the VRDisplay is capable of presenting content to an HMD or similar device. Can be used to indicate "magic window" devices that are capable of 6DoF tracking but for which VRDisplay.requestPresent() is not meaningful. If false then calls to VRDisplay.requestPresent() should always fail, and VRDisplay.getEyeParameters() should return null.

    -

    maxLayers Indicates the maximum length of the array that requestPresent() will accept. MUST be 1 if canPresent is true, 0 otherwise.

    +

    hasPosition The hasPosition attribute MUST return whether the VRDisplay is capable of tracking its position.

    +

    hasOrientation The hasOrientation attribute MUST return whether the VRDisplay is capable of tracking its orientation.

    +

    hasExternalDisplay The hasExternalDisplay attribute MUST return whether the VRDisplay is separate from the device’s primary display. If presenting VR content will obscure other content on the device, this should be false. When false, the application should not attempt to mirror VR content or update non-VR UI because that content will not be visible.

    +

    canPresent The canPresent attribute MUST return whether the VRDisplay is capable of presenting content to an HMD or similar device. Can be used to indicate "magic window" devices that are capable of 6DoF tracking but for which VRDisplay.requestPresent() is not meaningful. If false then calls to VRDisplay.requestPresent() should always fail, and VRDisplay.getEyeParameters() should return null.

    +

    maxLayers Indicates the maximum length of the array that requestPresent() will accept. MUST be 1 if canPresent is true, 0 otherwise.

    Note: Future revisions of this spec may allow multiple layers to enable more complex rendering effects such as compositing WebGL and DOM elements together. That functionality is not allowed by this revision of the spec.

    2.4. VREye

    enum VREye {
    @@ -1785,7 +1796,7 @@ 

    2.6.1. Attributes

    -

    position Position of the VRDisplay as a 3D vector. Position is given in meters from +

    position Position of the VRDisplay as a 3D vector. Position is given in meters from an origin point, which is either the position the sensor was first read at or the position of the sensor at the point that resetPose() was last called. The coordinate system uses these axis definitions:

    @@ -1885,12 +1896,12 @@

    getFrameData() is invoked for a given VRDisplay.

    +starts at 0 the first time getFrameData() is invoked for a given VRDisplay.

    leftProjectionMatrix A 4x4 matrix describing the projection to be used for the left eye’s rendering, given as a 16 element array in column major order. This value may be passed directly to WebGL’s uniformMatrix4fv function. It is highly recommended that applications use this matrix without modification. Failure to use this projection matrix when rendering may cause the presented frame to be distorted or badly aligned, resulting in varying degrees of user discomfort.

    leftViewMatrix A 4x4 matrix describing the view transform to be used for the left eye’s rendering, given as a 16 element array in column major order. Represents the inverse of the model matrix of the left eye in sitting space. This value may be passed directly to WebGL’s uniformMatrix4fv function. It is highly recommended that applications use this matrix when rendering.

    rightProjectionMatrix A 4x4 matrix describing the projection to be used for the right eye’s rendering, given as a 16 element array in column major order. This value may be passed directly to WebGL’s uniformMatrix4fv function. It is highly recommended that applications use this matrix without modification. Failure to use this projection matrix when rendering may cause the presented frame to be distorted or badly aligned, resulting in varying degrees of user discomfort.

    rightViewMatrix A 4x4 matrix describing the view transform to be used for the right eye’s rendering, given as a 16 element array in column major order. Represents the inverse of the model matrix of the right eye in sitting space. This value may be passed directly to WebGL’s uniformMatrix4fv function. It is highly recommended that applications use this matrix when rendering.

    -

    pose The VRPose of the VRDisplay at timestamp.

    +

    pose The VRPose of the VRDisplay at timestamp.

    2.8. VREyeParameters

    The VREyeParameters interface represents all the information required to correctly render a scene for a given eye.

    interface VREyeParameters {
    @@ -1903,8 +1914,8 @@ 

    2.8.1. Attributes

    -

    offset Offset from the center point between the users eyes to the center of the eye in meters. This value SHOULD represent half of the user’s interpupillary distance (IPD), but MAY also represent the distance from the center point of the headset to the center point of the lens for the given eye. Values for the left eye MUST be negative; values for the right eye MUST be positive. This information should not be used to construct a view matrix, prefer using the view matricies provided in VRFrameData instead.

    -

    fieldOfView (Deprecated) The current field of view for the eye. SHOULD conservatively cover the entire viewable frustum of the eye. The application should not use these values to construct a projection matrix, as it may not take into account all aspects of the VRDisplay optics. Prefer using the projection matrices provided in VRFrameData instead.

    +

    offset A three component vector describing the offset from the center point between the users eyes to the center of the eye in meters. The x component of this vector SHOULD represent half of the user’s interpupillary distance (IPD), but MAY also represent the vector from the center point of the headset to the center point of the lens for the given eye. Values in the x component for left eye MUST be negative; values in the x component for right eye MUST be positive. This information should not be used to construct a view matrix, prefer using the view matricies provided in VRFrameData instead.

    +

    fieldOfView (Deprecated) The current field of view for the eye. SHOULD conservatively cover the entire viewable frustum of the eye. The application should not use these values to construct a projection matrix, as it may not take into account all aspects of the VRDisplay optics. Prefer using the projection matrices provided in VRFrameData instead.

    renderWidth Describes the recommended render target width of each eye viewport, in pixels. If multiple eyes are rendered in a single render target, then the render target should be made large enough to fit both viewports. The renderWidth for the left eye and right eye MUST NOT overlap, and the renderWidth for the right eye MUST be to the right of the renderWidth for the left eye.

    renderHeight Describes the recommended render target height of each eye viewport, in pixels. If multiple eyes are rendered in a single render target, then the render target should be made large enough to fit both viewports. The renderWidth for the left eye and right eye MUST NOT overlap, and the renderWidth for the right eye MUST be to the right of the renderWidth for the left eye.

    @@ -1926,25 +1937,35 @@

    2.9.1. Attributes

    -

    sittingToStandingTransform The sittingToStandingTransform attribute is a 16-element array containing the components of a 4x4 affine transformation matrix in column-major order. This matrix transforms the sitting-space view matrices of VRFrameData to standing-space. Multiplying the inverse of this matrix with the leftViewMatrix or rightViewMatrix will result in a standing space view matrix for the respective eye.

    +

    sittingToStandingTransform The sittingToStandingTransform attribute is a 16-element array containing the components of a 4x4 affine transformation matrix in column-major order. This matrix transforms the sitting-space view matrices of VRFrameData to standing-space. Multiplying the inverse of this matrix with the leftViewMatrix or rightViewMatrix will result in a standing space view matrix for the respective eye.

    sizeX Width of the play-area bounds in meters. The bounds are defined as an axis-aligned rectangle on the floor. The center of the rectangle is at (0,0,0) in standing-space coordinates. These bounds are defined for safety purposes. Content should not require the user to move beyond these bounds; however, it is possible for the user to ignore the bounds resulting in position values outside of this rectangle.

    sizeZ Depth of the play-area bounds in meters. The bounds are defined as an axis-aligned rectangle on the floor. The center of the rectangle is at (0,0,0) in standing-space coordinates. These bounds are defined for safety purposes. Content should not require the user to move beyond these bounds; however, it is possible for the user to ignore the bounds resulting in position values outside of this rectangle.

    -

    2.10. Navigator Interface extension

    +

    2.10. VR Interface

    +
    interface VR : EventTarget {
    +  Promise<sequence<VRDisplay>> getDisplays();
    +  readonly attribute FrozenArray<VRDisplay> activeDisplays;
    +  readonly attribute boolean isEnabled;
    +};
    +
    +

    2.10.1. Attributes

    +

    getDisplays() Return a Promise which resolves to a list of available VRDisplays. The Promise MUST be rejected if the Document object is inside an iframe that does not have the allowvr attribute set.

    +

    activeDisplays activeDisplays includes every VRDisplay that is currently presenting.

    +

    isEnabled The isEnabled attribute’s getter must return true if the context object is allowed to use the feature indicated by attribute name allowvr and VR is supported, and false otherwise.

    +

    2.10.2. Events

    +

    The UA MUST provide the following new events. The corresponding events must be of type VRDisplayEvent and must fire on the vr object. Registration for and firing of the events must follow the usual behavior of DOM4 Events.

    +

    displayconnect A user agent MAY dispatch this event type to indicate that a VRDisplay has been connected.

    +

    displaydisconnect A user agent MAY dispatch this event type to indicate that a VRDisplay has been disconnected.

    +

    navigate A user agent MAY dispatch this event type to indicate that the current page has been navigated to from a page that was actively presenting VR content to the VRDisplay. The current page can call requestPresent() in response to this event in order to stay in VR presentation mode.

    +

    2.11. Navigator Interface extension

    partial interface Navigator {
    -  Promise<sequence<VRDisplay>> getVRDisplays();
    -  readonly attribute FrozenArray<VRDisplay> activeVRDisplays;
    -  readonly attribute boolean vrEnabled;
    +  readonly attribute VR vr;
     };
     
    - -

    getVRDisplays() Return a Promise which resolves to a list of available VRDisplays. The Promise MUST be rejected if the Document object is inside an iframe that does not have the allowvr attribute set.

    -

    activeVRDisplays activeVRDisplays includes every VRDisplay that is currently presenting.

    -

    vrEnabled The vrEnabled attribute’s getter must return true if the context object is allowed to use the feature indicated by attribute name allowvr and VR is supported, and false otherwise.

    -
    - The following code finds the first available VRDisplay. +
    + The following code finds the first available VRDisplay.
    var vrDisplay;
     
    -navigator.getVRDisplays().then(function (displays) {
    +navigator.vr.getDisplays().then(function (displays) {
       // Use the first display in the array if one is available. If multiple
       // displays are present, you may want to present the user with a way to
       // select which display to use.
    @@ -1954,7 +1975,7 @@ 
    -

    2.11. VRDisplayEventReason

    +

    2.12. VRDisplayEventReason

    enum VRDisplayEventReason {
       "navigation",
       "mounted",
    @@ -1962,51 +1983,32 @@ 

    "unmounted" };

    -

    2.11.1. Reasons

    +

    2.12.1. Reasons

    navigation The page has been navigated to from a context that allows this page to begin presenting immediately, such as from another site that was already in VR presentation mode.

    -

    mounted The VRDisplay has detected that the user has put it on.

    +

    mounted The VRDisplay has detected that the user has put it on.

    requested The user agent MAY request start VR presentation mode. This allows user agents to include a consistent UI to enter VR across diferent sites.

    -

    unmounted The VRDisplay has detected that the user has taken it off.

    -

    2.12. VRDisplayEvent

    -
    [Constructor(VRDisplayEventInit eventInitDict)]
    +   

    unmounted The VRDisplay has detected that the user has taken it off.

    +

    2.13. VRDisplayEvent

    +
    [Constructor(DOMString type, VRDisplayEventInit eventInitDict)]
     interface VRDisplayEvent : Event {
    -  readonly attribute VRDisplay display;
    +  readonly attribute VRDisplay display;
       readonly attribute VRDisplayEventReason? reason;
     };
     
     dictionary VRDisplayEventInit : EventInit {
    -  required VRDisplay display;
    +  required VRDisplay display;
       VRDisplayEventReason reason;
     };
     
    -

    2.12.1. Attributes

    -

    display The VRDisplay associated with this event.

    +

    2.13.1. Attributes

    +

    display The VRDisplay associated with this event.

    reason VRDisplayEventReason describing why this event has has been fired.

    -

    2.13. Window Interface extension

    -
    partial interface Window {
    -  attribute EventHandler onvrdisplayconnect;
    -  attribute EventHandler onvrdisplaydisconnect;
    -  attribute EventHandler onvrdisplayactivate;
    -  attribute EventHandler onvrdisplaydeactivate;
    -  attribute EventHandler onvrdisplayblur;
    -  attribute EventHandler onvrdisplayfocus;
    -  attribute EventHandler onvrdisplaypresentchange;
    -};
    -
    -

    User agents implementing this specification MUST provide the following new DOM events. The corresponding events must be of type VRDisplayEvent and must fire on the window object. Registration for and firing of the events must follow the usual behavior of DOM4 Events.

    -

    onvrdisplayconnect A user agent MAY dispatch this event type to indicate that a VRDisplay has been connected.

    -

    onvrdisplaydisconnect A user agent MAY dispatch this event type to indicate that a VRDisplay has been disconnected.

    -

    onvrdisplayactivate A user agent MAY dispatch this event type to indicate that something has occured which suggests the VRDisplay should be presented to. For example, if the VRDisplay is capable of detecting when the user has put it on, this event SHOULD fire when they do so with the reason "mounted".

    -

    onvrdisplaydeactivate A user agent MAY dispatch this event type to indicate that something has occured which suggests the VRDisplay should exit presentation. For example, if the VRDisplay is capable of detecting when the user has taken it off, this event SHOULD fire when they do so with the reason "unmounted".

    -

    onvrdisplayblur A user agent MAY dispatch this event type to indicate that presentation to the display by the page is paused by the user agent, OS, or VR hardware. While a VRDisplay is blurred it does not lose it’s presenting status (isPresenting continues to report true) but getFrameData() returns false without updating the provided VRFrameData and getPose() returns null. This is to prevent tracking while the user interacts with potentially sensitive UI. For example: A user agent SHOULD blur the presenting application when the user is typing a URL into the browser with a virtual keyboard, otherwise the presenting page may be able to guess the URL the user is entering by tracking their head motions.

    -

    onvrdisplayfocus A user agent MAY dispatch this event type to indicate that presentation to the display by the page has resumed after being blurred.

    -

    onvrdisplaypresentchange A user agent MUST dispatch this event type to indicate that a VRDisplay has begun or ended VR presentation. This event should not fire on subsequent calls to requestPresent() after the VRDisplay has already begun VR presentation.

    2.14. allowvr iframe attribute

    partial interface HTMLIFrameElement {
       attribute boolean allowvr;
     };
     
    -

    The allowvr attribute is a boolean attribute. When specified, it indicates that Document objects in the iframe element’s browsing context are to be allowed to access VR devices (if it’s not blocked for other reasons, e.g. there is another ancestor iframe without this attribute set). Document objects in an iframe element without this attribute should reject calls to getVRDisplays() and should not fire any VRDisplayEvent.

    +

    The allowvr attribute is a boolean attribute. When specified, it indicates that Document objects in the iframe element’s browsing context are to be allowed to access VR devices (if it’s not blocked for other reasons, e.g. there is another ancestor iframe without this attribute set). Document objects in an iframe element without this attribute should reject Promises returned by getDisplays() and should not fire any VRDisplayEvent.

    Example of declaring an iframe that is allowed to access VR features.
    <body>
    @@ -2021,12 +2023,12 @@ 

    2.15.1. Attributes

    -

    displayId Return the displayId of the VRDisplay this Gamepad is associated with. A Gamepad is considered to be associated with a VRDisplay if it reports a pose that is in the same space as the VRDisplay pose. If the Gamepad is not associated with a VRDisplay should return 0.

    +

    displayId Return the displayId of the VRDisplay this Gamepad is associated with. A Gamepad is considered to be associated with a VRDisplay if it reports a pose that is in the same space as the VRDisplay pose. If the Gamepad is not associated with a VRDisplay should return 0.

    3. Security Considerations

    While not directly affecting the API interface and Web IDL, WebVR implementations should maintain the user’s expectations of privacy, security, and comfort on the Web by adhering to the following guidelines:

    • -

      Trusted UI must be drawn by an independent rendering context who’s state is isolated from that of the WebGL contexts provided as a VRLayer source to a VRDisplay.

      +

      Trusted UI must be drawn by an independent rendering context who’s state is isolated from that of the WebGL contexts provided as a VRLayer source to a VRDisplay.

    • A "VR Compositor" runs asynchronously from content, responsible for compositing the trusted and untrusted content. If content is not performant or does not submit frames, or terminates unexpectedly the browser should be able to continue presenting a responsive front-end.

    • @@ -2034,13 +2036,13 @@

      3.
    • When navigating between pages in VR the browser should display trusted UI elements informing the user of the security information of the site they are navigating to which is normally presented by the 2D UI, such as the URL and encryption status.

    • -

      The VRDisplay pose and other VR inputs are only updated for the focused page.

      +

      The VRDisplay pose and other VR inputs are only updated for the focused page.

    • The Gamepad API will be updated such that the gamepad inputs are only updated for the focused page.

    • -

      Non-focused tabs are allowed to enumerate Gamepads and VRDisplays but will see last received state or default values.

      +

      Non-focused tabs are allowed to enumerate Gamepads and VRDisplays but will see last received state or default values.

    • -

      To prevent CORS-related vulnerabilities, each page will see a new instance of objects returned by the WebVR API, such as VRDisplay. Attributes such as the VRLayer.source set by one page must not be able to be read by another.

      +

      To prevent CORS-related vulnerabilities, each page will see a new instance of objects returned by the WebVR API, such as VRDisplay. Attributes such as the VRLayer.source set by one page must not be able to be read by another.

    4. Acknowledgements

    @@ -2193,21 +2195,26 @@

    Index

    Terms defined by this specification