[w3c/gamepad] gamepadconnected/disconnected events & non-"fully active" documents (#149)

Currently the [gamepadconnected](https://w3c.github.io/gamepad/#event-gamepadconnected) and [gamepaddisconnected](https://w3c.github.io/gamepad/#event-gamepaddisconnected) events fire on the (active document's?) window. It's a bit unclear how it interacts with non-"[fully active](https://html.spec.whatwg.org/multipage/browsers.html#fully-active)" (bfcached) documents. I think it's better if the text specify that the window the event is fired to is the [active document](https://html.spec.whatwg.org/multipage/browsers.html#active-document)'s window.

Also, it's probably a good chance to specify how bfcache restores are handled. Currently there's a text that says the `gamepadconnected` should fire "if a gamepad was already connected when the page was loaded". Does this include bfcache restore? What if a gamepad is connected then disconnected (possibly multiple times) while the document is in bfcache? Probably it makes sense to just send the last event (if it's different than the last dispatched event to the document) on bfcache restore (see our WIP [guide](https://pr-preview.s3.amazonaws.com/w3ctag/design-principles/317/b295eb7...rakina:7e7196c.html#gate-fully-active)).
 
cc @domenic @fergal

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/issues/149

Received on Wednesday, 19 May 2021 12:19:41 UTC