Bug 1776738 Comment 25 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Brad Werth [:bradwerth] from comment #22)
> Edgar, I'd like to hear your thoughts on my theory about the root cause in comment 21. Does this seem correct to you? If so, is there something already in the window fullscreen code that should handle this case and isn't working correctly?

Your theory is correct. I also noticed that some intermittent failures are caused by the transition effect, especially in test-verify mode. That's why fullscreen tests typically run without transitions, [as in test_fullscreen-api.html](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/dom/base/test/fullscreen/test_fullscreen-api.html#142-143). So, I think the issue isn't related to transitions.

---

(In reply to Brad Werth [:bradwerth] from comment #21)
> Make the fullscreenchange event fire after the sizemodechange event has been received. This would prevent the test from trying to enter fullscreen when the exit fullscreen is still being processed.

The  `fullscreenchange` event is fired from [FinishFullscreenChange](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/xpfe/appshell/AppWindow.cpp#2971) which [occurs after the sizemodechange event on Linux](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/widget/gtk/nsWindow.cpp#5238-5240)(and also on most of platform).

One possible case is that multiple `sizemodechange` events are triggered while exiting fullscreen. The first `sizemodechange` event triggers the `fullscreenchange`, allowing the test to continue and request fullscreen. However, the second `sizemodechange` event then arrives, causing the fullscreen state to be reset. But I am not sure if that is the case.
(In reply to Brad Werth [:bradwerth] from comment #22)
> Edgar, I'd like to hear your thoughts on my theory about the root cause in comment 21. Does this seem correct to you? If so, is there something already in the window fullscreen code that should handle this case and isn't working correctly?

Your theory is correct. I also noticed that some intermittent failures are caused by the transition effect, especially in test-verify mode. That's why fullscreen tests typically run without transitions, [as in test_fullscreen-api.html](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/dom/base/test/fullscreen/test_fullscreen-api.html#142-143). So, I think the issue isn't related to transitions.

---

(In reply to Brad Werth [:bradwerth] from comment #21)
> Make the fullscreenchange event fire after the sizemodechange event has been received. This would prevent the test from trying to enter fullscreen when the exit fullscreen is still being processed.

The  `fullscreenchange` event is fired from [FinishFullscreenChange](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/xpfe/appshell/AppWindow.cpp#2971) which [occurs after the sizemodechange event on Linux](https://searchfox.org/mozilla-central/rev/1157486abdf3245c2d3bf425745314c090745de5/widget/gtk/nsWindow.cpp#5238-5240) (and also on most of platform).

One possible case is that multiple `sizemodechange` events are triggered while exiting fullscreen. The first `sizemodechange` event triggers the `fullscreenchange`, allowing the test to continue and request fullscreen. However, the second `sizemodechange` event then arrives, causing the fullscreen state to be reset. But I am not sure if that is the case.

Back to Bug 1776738 Comment 25