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.
-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,
@@ -1471,6 +1473,7 @@
- This version: @@ -1435,6 +1435,8 @@
Chris Van Wiemeersch (Mozilla)
- Participate:
- File an issue (open issues) +
- Mailing list archive +
- W3C’s #webvr IRC
Table of Contents
2.1 VRDisplay2.2 VRLayer @@ -1505,21 +1508,22 @@ Table of Contents
2.9.1 Attributes - 2.10 Navigator Interface extension + 2.10 VR Interface + 2.11 Navigator Interface extension - 2.11 VRDisplayEventReason + 2.12 VRDisplayEventReason - 2.12 VRDisplayEvent + 2.13 VRDisplayEvent - 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 theVRDisplay
is not presenting the promise MUST be rejected.getLayers() Returns an array with the
VRLayer
currently being presented. MUST return an empty array if theVRDisplay
is not currently presenting. If theVRDisplay
is presenting MUST return an array containing theVRLayer
s last passed torequestPresent()
.submitFrame() Captures the current state of the
+VRLayer
currently being presented and displays it on theVRDisplay
. It is assumed that the frame was rendered using theVRPose
and matrices provided by the last call togetFrameData()
. IfgetFrameData()
was not called prior to callingsubmitFrame()
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 aVRDisplay
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 theVRDisplay
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 theVRDisplay
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) butgetFrameData()
returns false without updating the providedVRFrameData
andgetPose()
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 torequestPresent()
after theVRDisplay
has already begun VR presentation.- The following code demonstrates presenting a simple rendering loop to aVRDisplay
. + The following code demonstrates presenting a simple rendering loop to aVRDisplay
.var frameData = new VRFrameData(); // Render a single frame of VR data. @@ -1725,7 +1736,7 @@
2.2. VRLayer
-The
+VRLayer
interface is provided to aVRDisplay
and presented in the HMD.The
VRLayer
interface is provided to aVRDisplay
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 theVRDisplay
whenVRDisplay
.submitFrame()
is called.source The
source
attribute defines the canvas whose contents will be presented by theVRDisplay
whenVRDisplay
.submitFrame()
is called.leftBounds The
leftBounds
attribute contains four values defining the texture bounds within thesource
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). TheleftBounds
MUST default to[0.0, 0.0, 0.5, 1.0]
.rightBounds The
rightBounds
attribute contains four values defining the texture bounds rectangle within thesource
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). TherightBounds
MUST default to[0.5, 0.0, 0.5, 1.0]
.2.3. VRDisplayCapabilities
-The
+VRDisplayCapabilities
interface describes the capabilities of aVRDisplay
. These are expected to be static per-device/per-user.The
VRDisplayCapabilities
interface describes the capabilities of aVRDisplay
. 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 theVRDisplay
is capable of tracking its position.hasOrientation The
-hasOrientation
attribute MUST return whether theVRDisplay
is capable of tracking its orientation.hasExternalDisplay The
-hasExternalDisplay
attribute MUST return whether theVRDisplay
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 theVRDisplay
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 whichVRDisplay
.requestPresent()
is not meaningful. If false then calls toVRDisplay
.requestPresent()
should always fail, andVRDisplay
.getEyeParameters()
should return null.maxLayers Indicates the maximum length of the array that
+requestPresent()
will accept. MUST be 1 ifcanPresent
is true, 0 otherwise.hasPosition The
+hasPosition
attribute MUST return whether theVRDisplay
is capable of tracking its position.hasOrientation The
+hasOrientation
attribute MUST return whether theVRDisplay
is capable of tracking its orientation.hasExternalDisplay The
+hasExternalDisplay
attribute MUST return whether theVRDisplay
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 theVRDisplay
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 whichVRDisplay
.requestPresent()
is not meaningful. If false then calls toVRDisplay
.requestPresent()
should always fail, andVRDisplay
.getEyeParameters()
should return null.maxLayers Indicates the maximum length of the array that
requestPresent()
will accept. MUST be 1 ifcanPresent
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
@@ -1885,12 +1896,12 @@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 thatresetPose()
was last called. The coordinate system uses these axis definitions:getFrameData() is invoked for a given
VRDisplay
. +starts at 0 the first timegetFrameData()
is invoked for a givenVRDisplay
.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 theVRDisplay
attimestamp
.pose The
VRPose
of theVRDisplay
attimestamp
.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 inVRFrameData
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 inVRFrameData
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 therenderWidth
for the right eye MUST be to the right of therenderWidth
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 therenderWidth
for the right eye MUST be to the right of therenderWidth
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 ofVRFrameData
to standing-space. Multiplying the inverse of this matrix with theleftViewMatrix
orrightViewMatrix
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 ofVRFrameData
to standing-space. Multiplying the inverse of this matrix with theleftViewMatrix
orrightViewMatrix
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
+VRDisplay
s. The Promise MUST be rejected if theDocument
object is inside an iframe that does not have theallowvr
attribute set.activeDisplays
+activeDisplays
includes everyVRDisplay
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 nameallowvr
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 thevr
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 callrequestPresent()
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; };-2.10.1. Attributes
-getVRDisplays() Return a Promise which resolves to a list of available
-VRDisplay
s. The Promise MUST be rejected if theDocument
object is inside an iframe that does not have theallowvr
attribute set.activeVRDisplays
-activeVRDisplays
includes everyVRDisplay
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 nameallowvr
and VR is supported, and false otherwise.- The following code finds the first availableVRDisplay
. ++ 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 theVRDisplay
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 theVRDisplay
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) butgetFrameData()
returns false without updating the providedVRFrameData
andgetPose()
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 torequestPresent()
after theVRDisplay
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 thatDocument
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 togetVRDisplays()
and should not fire anyVRDisplayEvent
.The
allowvr
attribute is a boolean attribute. When specified, it indicates thatDocument
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 bygetDisplays()
and should not fire anyVRDisplayEvent
.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 theVRDisplay
thisGamepad
is associated with. AGamepad
is considered to be associated with aVRDisplay
if it reports a pose that is in the same space as theVRDisplay
pose. If theGamepad
is not associated with aVRDisplay
should return 0.displayId Return the
displayId
of theVRDisplay
thisGamepad
is associated with. AGamepad
is considered to be associated with aVRDisplay
if it reports a pose that is in the same space as theVRDisplay
pose. If theGamepad
is not associated with aVRDisplay
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 aVRDisplay
.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 aVRDisplay
.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
+Gamepad
s andVRDisplay
s but will see last received state or default values.Non-focused tabs are allowed to enumerate
Gamepad
s andVRDisplay
s 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 theVRLayer
.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 theVRLayer
.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
-
- activeVRDisplays, in §2.10.1 +
- activate, in §2.1.2 +
- activeDisplays, in §2.10.1
- allowvr, in §2.14
- angularAcceleration, in §2.6.1
- angularVelocity, in §2.6.1 +
- blur, in §2.1.2
- cancelAnimationFrame(handle), in §2.1.1
- canPresent, in §2.3.1
- capabilities, in §2.1.1 +
- deactivate, in §2.1.2
- depthFar, in §2.1
- depthNear, in §2.1
- display
-
+- dict-member for VRDisplayEventInit, in §2.12 -
- attribute for VRDisplayEvent, in §2.12.1 +
- dict-member for VRDisplayEventInit, in §2.13 +
- attribute for VRDisplayEvent, in §2.13.1
- displayconnect, in §2.10.2 +
- displaydisconnect, in §2.10.2
- displayId
@@ -2218,15 +2225,17 @@
downDegrees, in §2.5
- exitPresent(), in §2.1.1
- fieldOfView, in §2.8.1 +
- focus, in §2.1.2 +
- getDisplays(), in §2.10.1
- getEyeParameters(whichEye), in §2.1.1
- getFrameData(frameData), in §2.1.1
- getLayers(), in §2.1.1
- getPose(), in §2.1.1 -
- getVRDisplays(), in §2.10.1
- hasExternalDisplay, in §2.3.1
- hasOrientation, in §2.3.1
- hasPosition, in §2.3.1
- isConnected, in §2.1.1 +
- isEnabled, in §2.10.1
- isPresenting, in §2.1.1
- "left", in §2.4
- left, in §2.4 @@ -2237,64 +2246,24 @@
linearAcceleration, in §2.6.1
- linearVelocity, in §2.6.1
- maxLayers, in §2.3.1 -
- mounted, in §2.11.1 -
- navigation, in §2.11.1 +
- mounted, in §2.12.1 +
- navigate, in §2.10.2 +
- navigation, in §2.12.1
- offset, in §2.8.1 -
- - onvrdisplayactivate -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplayblur -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplayconnect -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplaydeactivate -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplaydisconnect -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplayfocus -
-
-- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- - onvrdisplaypresentchange -
-
- attribute for Window, in §2.13 -
- event for Window, in §2.13 -
- orientation, in §2.6.1
- pose, in §2.7.1
- position, in §2.6.1 +
- presentchange, in §2.1.2
- reason
-
- dict-member for VRDisplayEventInit, in §2.12 -
- attribute for VRDisplayEvent, in §2.12.1 +
- dict-member for VRDisplayEventInit, in §2.13 +
- attribute for VRDisplayEvent, in §2.13.1
- renderHeight, in §2.8.1
- renderWidth, in §2.8.1
- requestAnimationFrame(callback), in §2.1.1 -
- requested, in §2.11.1 +
- requested, in §2.12.1
- requestPresent(layers), in §2.1.1
- resetPose(), in §2.1.1
- right, in §2.4 @@ -2310,15 +2279,16 @@
stageParameters, in §2.1
- submitFrame(), in §2.1.1
- timestamp, in §2.7.1 -
- unmounted, in §2.11.1 +
- unmounted, in §2.12.1
- upDegrees, in §2.5 +
- vr, in §2.11 +
- VR, in §2.10
- VRDisplay, in §2.1
- VRDisplayCapabilities, in §2.3 -
- VRDisplayEvent, in §2.12 -
- VRDisplayEvent(eventInitDict), in §2.12 -
- VRDisplayEventInit, in §2.12 -
- VRDisplayEventReason, in §2.11 -
- vrEnabled, in §2.10.1 +
- VRDisplayEvent, in §2.13 +
- VRDisplayEventInit, in §2.13 +
- VRDisplayEventReason, in §2.12 +
- VRDisplayEvent(type, eventInitDict), in §2.13
- VREye, in §2.4
- VREyeParameters, in §2.8
- VRFieldOfView, in §2.5 @@ -2341,16 +2311,14 @@
[HTML] defines the following terms:
-
- Document -
- EventHandler +
- Document
- FrameRequestCallback
- HTMLCanvasElement
- HTMLIFrameElement
- Navigator -
- Window
- - [WebIDL-1] defines the following terms: + [WebIDL] defines the following terms:
-
- NewObject
- SameObject @@ -2363,8 +2331,8 @@
N
- Ian Hickson. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
- [RFC2119]
- S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119 -
- [WebIDL-1] -
- Cameron McCormack; Boris Zbarsky. WebIDL Level 1. 15 September 2016. PR. URL: https://heycam.github.io/webidl/ +
- [WebIDL] +
- Cameron McCormack; Boris Zbarsky; Tobie Langel. Web IDL. URL: https://heycam.github.io/webidl/
- [WHATWG-DOM]
- Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/ @@ -2557,10 +2525,14 @@
I readonly attribute float sizeZ; }; +interface VR : EventTarget { + Promise<sequence<VRDisplay>> getDisplays(); + readonly attribute FrozenArray<VRDisplay> activeDisplays; + readonly attribute boolean isEnabled; +}; + partial interface Navigator { - Promise<sequence<VRDisplay>> getVRDisplays(); - readonly attribute FrozenArray<VRDisplay> activeVRDisplays; - readonly attribute boolean vrEnabled; + readonly attribute VR vr; }; enum VRDisplayEventReason { @@ -2570,7 +2542,7 @@
I "unmounted" }; -[Constructor(VRDisplayEventInit eventInitDict)] +[Constructor(DOMString type, VRDisplayEventInit eventInitDict)] interface VRDisplayEvent : Event { readonly attribute VRDisplay display; readonly attribute VRDisplayEventReason? reason; @@ -2581,16 +2553,6 @@
I VRDisplayEventReason reason; }; -partial interface Window { - attribute EventHandler onvrdisplayconnect; - attribute EventHandler onvrdisplaydisconnect; - attribute EventHandler onvrdisplayactivate; - attribute EventHandler onvrdisplaydeactivate; - attribute EventHandler onvrdisplayblur; - attribute EventHandler onvrdisplayfocus; - attribute EventHandler onvrdisplaypresentchange; -}; - partial interface HTMLIFrameElement { attribute boolean allowvr; }; @@ -2604,22 +2566,24 @@
I #vrdisplayReferenced in:
- 2.1. VRDisplay -
- 2.1.1. Attributes (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) (23) -
- 2.2. VRLayer -
- 2.2.1. Attributes (2) -
- 2.3. VRDisplayCapabilities -
- 2.3.1. Attributes (2) (3) (4) (5) (6) (7) -
- 2.6.1. Attributes -
- 2.7.1. Attributes (2) -
- 2.8.1. Attributes -
- 2.10. Navigator Interface extension (2) -
- 2.10.1. Attributes (2) (3) -
- 2.11.1. Reasons (2) -
- 2.12. VRDisplayEvent (2) -
- 2.12.1. Attributes -
- 2.13. Window Interface extension (2) (3) (4) (5) (6) (7) (8) (9) -
- 2.15.1. Attributes (2) (3) (4) -
- 3. Security Considerations (2) (3) (4) +
- 2.1.1. Attributes (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19) (20) (21) (22) +
- 2.1.2. Events (2) (3) (4) (5) (6) (7) (8) (9) +
- 2.2. VRLayer +
- 2.2.1. Attributes (2) +
- 2.3. VRDisplayCapabilities +
- 2.3.1. Attributes (2) (3) (4) (5) (6) (7) +
- 2.6.1. Attributes +
- 2.7.1. Attributes (2) +
- 2.8.1. Attributes +
- 2.10. VR Interface (2) +
- 2.10.1. Attributes (2) +
- 2.10.2. Events (2) (3) +
- 2.11. Navigator Interface extension +
- 2.12.1. Reasons (2) +
- 2.13. VRDisplayEvent (2) +
- 2.13.1. Attributes +
- 2.15.1. Attributes (2) (3) (4) +
- 3. Security Considerations (2) (3) (4)