| // Copyright 2017 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // https://immersive-web.github.io/webxr/#xrsession-interface |
| enum XREnvironmentBlendMode { |
| "opaque", |
| "additive", |
| "alpha-blend", |
| }; |
| |
| [ |
| ActiveScriptWrappable, |
| SecureContext, |
| Exposed=Window, |
| OriginTrialEnabled=WebXR |
| ] interface XRSession : EventTarget { |
| readonly attribute boolean immersive; |
| readonly attribute XRPresentationContext outputContext; |
| readonly attribute XREnvironmentBlendMode environmentBlendMode; |
| |
| attribute double depthNear; |
| attribute double depthFar; |
| |
| attribute XRLayer baseLayer; |
| |
| attribute EventHandler onblur; |
| attribute EventHandler onfocus; |
| attribute EventHandler onresetpose; |
| attribute EventHandler onend; |
| |
| [CallWith=ScriptState] Promise<XRReferenceSpace> requestReferenceSpace([PermissiveDictionaryConversion] XRReferenceSpaceOptions options); |
| |
| long requestAnimationFrame(XRFrameRequestCallback callback); |
| void cancelAnimationFrame(long handle); |
| |
| [MeasureAs=XRSessionGetInputSources] FrozenArray<XRInputSource> getInputSources(); |
| |
| [RuntimeEnabled=WebXRHitTest, CallWith=ScriptState] Promise<FrozenArray<XRHitResult>> requestHitTest(Float32Array origin, Float32Array direction, XRSpace space); |
| |
| [CallWith=ScriptState] Promise<void> end(); |
| }; |