WebVR scenes not rendering in magic window through an iframe |
|||||
Issue descriptionChrome Version: Chrome Canary, 66.0.3356.0, Chrome Beta 65.0.3325.85, Chrome 64.0.3282.137 OS: Android What steps will reproduce the problem? (1) Enable WebVR in chrome://flags (2) Go to https://aframe.io/examples/ What is the expected result? The A-frame example should render the scene through the magic window feature. What happens instead? The A-frame example does not render the scene. If you tap the scene, the scene will get rendered. Additional Information The A-frame example is loaded through an iframe. In order for the scene to render, the frame needs to receive focus. Normally if the page has blur, then the scene does not get rendered: void VRDisplay::RequestVSync() { ... if (display_blurred_) return; ... } This function returns whether the frame is focused: bool VRDisplay::FocusedOrPresenting() { // The browser can't track focus for frames, so we still need to check for // focus in the renderer, even if the browser is checking focus before // sending input. return navigator_vr_->IsFocused() || is_presenting_; } And this function reports if the frame has focus: void NavigatorVR::FocusedFrameChanged() { bool focused = IsFrameFocused(GetSupplementable()->GetFrame()); if (focused == focused_) return; focused_ = focused; if (controller_) { controller_->SetListeningForActivate(listening_for_activate_ && focused); controller_->FocusChanged(); } } The problem is in void NavigatorVR::FocusedFrameChanged(), specifically this line: bool focused = IsFrameFocused(GetSupplementable()->GetFrame());. The focused flag should check if the page has focus, so all child frames receive focus as well. Currently, the parent frame has focus, but the child frame (iframe in the above website) does not receive focus and fails to call RequestVSync() to render in magic window. Also, from my understanding, these methods 'onvrdisplayblur' and 'onvrdisplayfocus' refer to the display/page and not a frame on the page? I attached a diff that fixes this problem, but it might not be the complete solution.
,
Feb 28 2018
This is currently working as intended. We intentionally don't want unfocused frames to receive the input and tracking data provided by the VR APIs. There are many reasons for this, but one key one is that we don't want to allow cross-origin content to do things like side-channel attacks using the high-accuracy sensor data provided by the VR APIs to figure out what the user is doing on the host page, up to and including things like keylogging. We could consider relaxing this to allow same-origin frames without focus, but then we'd probably also want to re-use poses across navigators for the same frame or something so we're not doing extra unnecessary IPC for each additional webVR frame on the page. I think the best solution here is just for A-frame to focus the iframe that it wants webVR active in.
,
Feb 28 2018
navigators for the same page*
,
Feb 28 2018
For spec discussion, see https://github.com/immersive-web/webxr/issues/250. We should address that before making complex changes.
,
Mar 1 2018
Thanks for clarifying. I'll notify the A-frame team.
,
Mar 6 2018
Winston, assigning back to you. Could you mark this as WontFix once you've notified A-frame, etc?
,
Apr 9 2018
Hi, I submitted an issue a while back (https://github.com/aframevr/aframe/issues/3411).
,
Apr 9 2018
,
Jul 4
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Feb 28 2018