[whatwg] "fullscreenchange" event should be delayed to after transition is complete
Brandon Jones
tojiro at gmail.com
Tue May 15 20:13:21 PDT 2012
I've had intermittent issues with this as well, and completely agree that
the even should happen after the transition is done. Barring that, it would
be useful if the elements on the page reported their post-transition sizes
and positions in the even callback.
In the same vein, I'd also like to point out that I've had very similar
issues with orientationchange on mobile devices. Many mobile browsers have
a quick "rotating" animation that accompanies an orientation change, but
the related events seem to fire before the page is actually transformed.
The best method I've found for handling it is to start a ~1sec timeout
after the orientation change event before measuring any elements. That
creates a noticeable delay in the layout update for the users though.
In short, any APIs that transform the document like this really ought to
specify that the related events fire post-transition.
-Brandon
On Tue, May 15, 2012 at 5:33 PM, Chris Pearce <cpearce at mozilla.com> wrote:
> Hi,
>
> I think that the "fullscreenchange" even dispatch should be specified to
> be dispatched once the animation to transition to/from fullscreen has
> finished.
>
> The problem is that at least two of the platforms we're supporting have
> non-instantaneous transitions from windowed to fullscreen mode. So if we
> dispatch "fullscreenchange" events as specified during
> HTMLElement.requestFullscreen(**) then the "fullscreenchange" events can
> arrive before the transition animation has finished, so things like
> window.screenY and window.size.* haven't reached their stable fullscreen
> values.
>
> Our unit tests have been randomly failing because of this, so I'm sure
> this will cause problems with authors in the wild.
>
> I think having the state changes performed by
> HTMLElement.requestFullscreen(**) happen synchronously before the
> animation/transition to enter fullscreen completes (as specified currently)
> and having them undone before the animation to exit fullscreen completes
> (also as specified currently in exitFullscreen()) is probably OK, since
> these state changes maybe required for the transition/animation. It's only
> the dispatch of "fullscreenchange" I think we should change.
>
>
> Cheers,
> Chris Pearce.
>
More information about the whatwg
mailing list