[whatwg/fullscreen] Document state change should be synced with dimensions change (#37)

The current implementation in Gecko is that, the document state (document flag, element state, etc.) is changed immediately when the dimension gets changed. It doesn't really match the current spec.

The reason is that, I think it is more important to always keep the document state consistent with its dimensions.

If we change the window dimensions, but delay the state change to the next animation frame, there is a chance script could detect the intermediate state where the fullscreen flags are not ready but the window dimensions have been changed. The intermediate is not useful at all.

There is also a performance concern that, detecting the intermediate state itself could trigger a resize reflow (e.g. for querying element size). But if we do resize reflow at that moment, we will need another reflow for fullscreen change. Two reflows can be expensive.

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

Received on Thursday, 31 March 2016 00:06:17 UTC