Closed Bug 1436015 Opened 6 years ago Closed 6 years ago

Full screen is dismissed when using spacebar key

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox58 --- wontfix
firefox59 --- fix-optional
firefox60 --- fix-optional

People

(Reporter: mboldan, Unassigned)

Details

[Affected versions]:
- Firefox 58.0.1, Firefox 59.0b7, Firefox 60.0a1 (2018-02-05)

[Affected platforms]:
- Windows 10x64, Windows 7x64, Ubuntu 14.04x64

[Steps to reproduce]:
1. Launch Firefox.
2. Go to https://www.twitch.tv/.
3. Enter in full screen mode by clicking the Full Screen button.
4. Hit the space bar key.

[Expected result]:
- The game is paused.

[Actual result]:
- The game is correctly paused, but it's also exits the Full screen mode.

[Regression range]:
- I will look for the regression asap.

[Additional notes]:
- This issue is not reproducible on macOS.
- The issue is not reproducible if entering in full screen by double clicking the video.
- It's also reproducible on other websites - YouTube, Vimeo, etc.
This doesn't seem to be a recent regression since the issue is also reproducible on Firefox 28.0a1(2013-11-04). 
I couldn't go further with the regression range, since on the earlier builds, videos from the sites mentioned in the Comment 0 are not supported.
Component: General → Keyboard: Navigation
Component: Keyboard: Navigation → DOM
Flags: needinfo?(xidorn+moz)
From the stack, it seems the exiting is triggered from the script, and played a bit with this, my guess is that this is because the focus is somehow on the fullscreen button, and when you press space, the fullscreen button is effectively clicked, and thus it invokes exitFullscreen. It can be proved that, if you click something else after entering fullscreen (e.g. the gear), pressing space no longer exits fullscreen, and if you don't do anything, just press space continuously, it would alternate between fullscreen and non-fullscreen.

And I cannot reproduce this issue with Youtube, but I can reproduce it on Vimeo, which seems to have the same issue as above.

As of my test, Chrome also puts focus on the button after user clicks it. So the question becomes, why pressing space triggers those buttons on Firefox but not Chrome? That is a question unrelated to fullscreen.

This is probably related to event handling. As far as I can see, if I invoke preventDefault() on keydown or keypress event, Chrome wouldn't trigger click on button, while Firefox would still trigger that. This might be the reason (which I don't actually verify).

So moving this to DOM: Events.
Component: DOM → DOM: Events
Flags: needinfo?(xidorn+moz)
I just tried on Windows in twitch.tv and youtube.com, but was not able to reproduce. This was using Firefox 60.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.