Skip to content

Commit 0f4c33d

Browse files
Fix outdated comments still mentioning WebVR (#5694)
1 parent 067551f commit 0f4c33d

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

‎src/core/scene/a-scene.js‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export class AScene extends AEntity {
245245
}
246246

247247
/**
248-
* Call `requestPresent` if WebVR or WebVR polyfill.
248+
* Call `requestSession` if WebXR is supported.
249249
* Call `requestFullscreen` on desktop.
250250
* Handle events, states, fullscreen styles.
251251
*
@@ -325,10 +325,7 @@ export class AScene extends AEntity {
325325
}
326326
self.addFullScreenStyles();
327327

328-
// On mobile, the polyfill handles fullscreen.
329-
// TODO: 07/16 Chromium builds break when `requestFullscreen`ing on a canvas
330-
// that we are also `requestPresent`ing. Until then, don't fullscreen if headset
331-
// connected.
328+
// Call `requestFullscreen` on desktop
332329
if (!self.isMobile && !self.checkHeadsetConnected()) {
333330
requestFullscreen(self.canvas);
334331
}
@@ -339,7 +336,7 @@ export class AScene extends AEntity {
339336
}
340337

341338
/**
342-
* Call `exitPresent` if WebVR / WebXR or WebVR polyfill.
339+
* Call `xrSession.end` if WebXR.
343340
* Handle events, states, fullscreen styles.
344341
*
345342
* @returns {Promise}
@@ -351,7 +348,7 @@ export class AScene extends AEntity {
351348
// Don't exit VR if not in VR.
352349
if (!this.is('vr-mode') && !this.is('ar-mode')) { return Promise.resolve('Not in immersive mode.'); }
353350

354-
// Handle exiting VR if not yet already and in a headset or polyfill.
351+
// Handle exiting VR if not yet already and in a headset or mobile.
355352
if (this.checkHeadsetConnected() || this.isMobile) {
356353
vrManager.enabled = false;
357354
if (this.hasWebXR) {
@@ -469,10 +466,10 @@ export class AScene extends AEntity {
469466
isVRPresenting = this.renderer.xr.enabled && isPresenting;
470467

471468
// Do not update renderer, if a camera or a canvas have not been injected.
472-
// In VR mode, three handles canvas resize based on the dimensions returned by
473-
// the getEyeParameters function of the WebVR API. These dimensions are independent of
469+
// In VR mode, three handles canvas resize based on the dimensions of the created
470+
// XRWebGLLayer or XRProjectionLayer. These dimensions are independent of
474471
// the window size, therefore should not be overwritten with the window's width and
475-
// height, // except when in fullscreen mode.
472+
// height, except when in fullscreen mode.
476473
if (!camera || !canvas || (this.is('vr-mode') && (this.isMobile || isVRPresenting))) {
477474
return;
478475
}
@@ -835,7 +832,7 @@ function getCanvasSize (canvasEl, embedded, maxSize, isVR) {
835832

836833
/**
837834
* Return the canvas size. Will be the window size unless that size is greater than the
838-
* maximum size (1920x1920 by default). The constrained size will be returned in that case,
835+
* maximum size (no maximum by default). The constrained size will be returned in that case,
839836
* maintaining aspect ratio
840837
*
841838
* @param {object} maxSize - Max size parameters (width and height).

‎src/utils/device.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ var supportsARSession = false;
66

77
export var isWebXRAvailable = navigator.xr !== undefined;
88

9-
// Support both WebVR and WebXR APIs.
109
if (isWebXRAvailable) {
1110
var updateEnterInterfaces = function () {
1211
var sceneEl = document.querySelector('a-scene');

‎tests/core/scene/a-scene.test.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ suite('a-scene (without renderer) - WebXR', function () {
117117
});
118118
});
119119

120-
test('calls requestPresent if headset connected', function (done) {
120+
test('calls requestSession if headset connected', function (done) {
121121
var sceneEl = this.el;
122122
this.sinon.stub(sceneEl, 'checkHeadsetConnected').returns(true);
123123
window.hasNativeWebVRImplementation = false;
@@ -127,7 +127,7 @@ suite('a-scene (without renderer) - WebXR', function () {
127127
});
128128
});
129129

130-
test('calls requestPresent on mobile', function (done) {
130+
test('calls requestSession on mobile', function (done) {
131131
var sceneEl = this.el;
132132
sceneEl.isMobile = true;
133133
sceneEl.enterVR().then(function () {
@@ -136,7 +136,7 @@ suite('a-scene (without renderer) - WebXR', function () {
136136
});
137137
});
138138

139-
test('does not call requestPresent if flat desktop', function (done) {
139+
test('does not call requestSession if flat desktop', function (done) {
140140
var sceneEl = this.el;
141141
this.sinon.stub(sceneEl, 'checkHeadsetConnected').returns(false);
142142
this.sinon.stub(sceneEl.canvas, 'requestFullscreen');
@@ -238,7 +238,7 @@ suite('a-scene (without renderer) - WebXR', function () {
238238
});
239239
});
240240

241-
test('calls exitPresent if headset connected', function (done) {
241+
test('calls xrSession.end if headset connected', function (done) {
242242
var sceneEl = this.el;
243243
this.sinon.stub(sceneEl, 'checkHeadsetConnected').returns(true);
244244
sceneEl.xrSession = {
@@ -251,7 +251,7 @@ suite('a-scene (without renderer) - WebXR', function () {
251251
});
252252
});
253253

254-
test('calls exitPresent on mobile', function (done) {
254+
test('calls xrSession.end on mobile', function (done) {
255255
this.sinon.stub(screen.orientation, 'lock');
256256
var sceneEl = this.el;
257257
sceneEl.isMobile = true;
@@ -265,7 +265,7 @@ suite('a-scene (without renderer) - WebXR', function () {
265265
});
266266
});
267267

268-
test('does not call exitPresent on desktop without a headset', function (done) {
268+
test('does not call xrSession.end on desktop without a headset', function (done) {
269269
var sceneEl = this.el;
270270
sceneEl.renderer.xr.enabled = true;
271271
sceneEl.isMobile = false;

0 commit comments

Comments
 (0)