New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Proj-XR


Show other hotlists

Hotlists containing this issue:
VR-Automated-Tests


Sign in to add a comment
link

Issue 718246: WebVR: Do not fire window.requestAnimationFrame while presenting on Android

Reported by ddorwin@chromium.org, May 4 2017 Project Member

Issue description

[This is the opposite of  issue 704341  and reflects a change in desired behavior on Android.]

The consensus seems to be that window.requestAnimationFrame should be tied to page visibility. [1]

Thus, we should not fire window.requestAnimationFrame on Android when WebVR is presenting. This may cause issues for some sites or libraries. Those will need to be fixed.

[1] https://github.com/w3c/webvr/issues/225#issuecomment-298778492 as well as internal discussions.
 

Comment 1 by meganlindsay@chromium.org, Jun 7 2017

Labels: -M-60

Comment 2 by meganlindsay@chromium.org, Jun 7 2017

Labels: -Pri-3 M-61 Pri-2

Comment 3 by ddorwin@chromium.org, Jun 7 2017

Cc: mscales@chromium.org meganlindsay@chromium.org
This may affect some apps. As such, we should do it early in the milestone. We should also reach out to those that were affected last time rAF was not fired on Android. This includes threejs, which is mentioned in  issue 704341 .

Comment 4 by mscales@chromium.org, Jun 9 2017

Cc: ricardocabello@google.com
+ricardocabello for the ThreeJS question.

This will cause a whole bunch of subtle bugs, I think. For many people their loop looks something like:

function main() {
  if (display.isPresenting) {
    ...
    display.requestAnimationFrame(main);
  } else {
    ...
    window.requestAnimationFrame(main);
  }
}

This gives you one frame after entering presentation mode where you are driving the VR loop from a window rAF, which I assume will no longer be fired. I imagine this just kills the loop altogether.

Developers should, of course, cancel the rAF when they begin/end presenting and call the correct one, but due to being *very slightly* more complicated, I wonder if many people currently do it correctly.

Comment 5 by mthiesse@chromium.org, Jun 9 2017

We actually handle this case explicitly, by manually firing a single extra window rAF after presentation starts.

Should this be part of the spec? Other implementers may have different behavior here in the future. Or does the 2.0 spec address this somehow?

Comment 6 by vollick@chromium.org, Jul 10 2017

Megan, what's the next step here?

Comment 7 by ddorwin@chromium.org, Jul 27 2017

Labels: -Pri-2 -M-61 M-62 Pri-1

Comment 8 by ddorwin@chromium.org, Aug 11 2017

Cc: klausw@chromium.org
Owner: ----
Status: Available (was: Assigned)
I believe this is just a matter of reverting the CL in  issue 704341  (and verifying behavior). It doesn't revert cleanly, but it is small.

Comment 9 by cjgrant@chromium.org, Aug 23 2017

Owner: cjgrant@chromium.org
Status: Started (was: Available)

Comment 10 by bugdroid1@chromium.org, Aug 24 2017

Project Member
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1b6a5e96191538ad8a4e0918a14b8724016b4d27

commit 1b6a5e96191538ad8a4e0918a14b8724016b4d27
Author: Christopher Grant <cjgrant@chromium.org>
Date: Thu Aug 24 14:19:08 2017

VR: Do not fire window.rAF while presenting

As per the associated bug, we're reverting an extra call to
window.requestAnimaionFrame. Separate code already triggers a rAF when
presentation starts.

BUG= 718246 

Change-Id: I5bf961749d80476572f1610a3992e62a4e6a5301
Reviewed-on: https://chromium-review.googlesource.com/628963
Reviewed-by: Michael Thiessen <mthiesse@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497034}
[modify] https://crrev.com/1b6a5e96191538ad8a4e0918a14b8724016b4d27/third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Comment 11 by cjgrant@chromium.org, Aug 24 2017

Status: Fixed (was: Started)

Comment 12 by btebbs@chromium.org, Jul 4 2018

Components: Blink>WebXR

Sign in to add a comment