Skip to content

Commit

Permalink
Expose onvisibilitychange
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Oct 11, 2019
1 parent d90317c commit 49a8ed0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/webidls/XRSession.webidl
Expand Up @@ -42,5 +42,5 @@ interface XRSession : EventTarget {
// attribute EventHandler oninputsourceschange;
attribute EventHandler onselectstart;
attribute EventHandler onselectend;
// attribute EventHandler onvisibilitychange;
attribute EventHandler onvisibilitychange;
};
11 changes: 10 additions & 1 deletion components/script/dom/xrsession.rs
Expand Up @@ -49,7 +49,9 @@ use profile_traits::ipc;
use std::cell::Cell;
use std::mem;
use std::rc::Rc;
use webxr_api::{self, EnvironmentBlendMode, Event as XREvent, Frame, SelectEvent, Session, Visibility};
use webxr_api::{
self, EnvironmentBlendMode, Event as XREvent, Frame, SelectEvent, Session, Visibility,
};

#[dom_struct]
pub struct XRSession {
Expand Down Expand Up @@ -313,6 +315,13 @@ impl XRSessionMethods for XRSession {
/// https://immersive-web.github.io/webxr/#eventdef-xrsession-selectend
event_handler!(selectend, GetOnselectend, SetOnselectend);

/// https://immersive-web.github.io/webxr/#eventdef-xrsession-visibilitychange
event_handler!(
visibilitychange,
GetOnvisibilitychange,
SetOnvisibilitychange
);

// https://immersive-web.github.io/webxr/#dom-xrsession-renderstate
fn RenderState(&self) -> DomRoot<XRRenderState> {
self.active_render_state.get()
Expand Down
3 changes: 0 additions & 3 deletions tests/wpt/metadata/webxr/idlharness.https.window.js.ini
Expand Up @@ -14,9 +14,6 @@
[XR interface: calling supportsSession(XRSessionMode) on navigator.xr with too few arguments must throw TypeError]
expected: FAIL

[XRSession interface: attribute onvisibilitychange]
expected: FAIL

[XRInputSourcesChangeEvent interface object length]
expected: FAIL

Expand Down

0 comments on commit 49a8ed0

Please sign in to comment.