[whatwg] Fullscreen events dispatched to elements

Chris Pearce cpearce at mozilla.com
Fri Jun 1 18:45:24 PDT 2012


On 2/06/2012 11:19 a.m., Vincent Scheib wrote:
> IMHO Pointer Lock would be more convenient to use if events are sent
> to the target element as well, and not just the document.
>
> Is there a reason the Fullscreen specification doesn't dispatch events
> to the most relevant element?

Because we exit fullscreen when the fullscreen element is removed from 
the document, so if you dispatch events to the context element, the 
"fullscreenchange" event never bubbles up to the containing document in 
the exit-on-remove case.

Because of this, the spec was then changed to dispatch fullscreenchange 
to the context element on entering fullscreen, and to the document on 
exit, but we found this inconsistent, since a listener has to listen to 
multiple nodes to receive both exit and enter events, so the spec was 
changed again to always dispatch "fullscreenchange" to the document.


Regards,
Chris P.




More information about the whatwg mailing list