Closed Bug 1725884 Opened 3 years ago Closed 3 years ago

pressing escape exits both full screen video and full screen Firefox

Categories

(Core :: Widget: Cocoa, defect, P1)

Firefox 93
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox91 --- unaffected
firefox92 + disabled
firefox93 + disabled

People

(Reporter: mozilla, Unassigned)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [mac:fullscreen])

STR:

Open Firefox (single window)
Set to full screen (View -> Enter Full Screen, or cmd-shift-f)
Go to Youtube
Play a video
Enter full screen in the video
Hit Esc

Expected Results: Video exits full screen, but browser stays full screen until I hit Esc a second time.

Actual Results: both video and browser exit full screen.

I've noticed this elsewhere as well, Gmail especially, but I'm not sure I could successfully argue that we should ignore the Esc in those cases. But when both browser and the video are full screen, from a user perspective it seems only one of them, the video, should exit full screen on Esc.

(This is currently my top Fx papercut, probably because I'm using Fx full screen on my laptop until my external monitor gets here.)

Do other browsers have the same issue?

Safari appears to perform with the Expected Results: one Esc to exit full screen video, one Esc to exit full screen browser.
Chrome doesn't exit full screen browser mode with Esc, which is also acceptable behavior IMO; you exit full screen video with Esc, and you exit full screen browser with another ctrl-cmd-F.

I don't think we use Esc to exit the browser full screen mode either. It should only exit the full screen for the website.

What system are you on? I just tested on my Firefox 91 and 93 Nightly on Ubuntu, and I don't see the problem you mention.

I have been struggling with this issue, or one like it, in Firefox Developer Edition 92.0b4 on OS X. It does not occur in my regular Firefox 91.0 install though. Any time I hit escape in 92 it exits the OS X full screen mode. This can be really annoying when I am trying to exit a modal or close the excel embed for gmail. It has really messed with my workflow for the last couple days. It doesn't seem to be effecting Youtube for me but it is a problem on most other sites. It is frustrating when I am not sure if the escape key is bound to close a modal on a page and it ends up kicking me out of full screen. Or, even worse, it closes the modal and kicks me out of full screen anyways.

(In reply to Xidorn Quan [:xidorn] UTC+11 from comment #3)

I don't think we use Esc to exit the browser full screen mode either. It should only exit the full screen for the website.

What system are you on? I just tested on my Firefox 91 and 93 Nightly on Ubuntu, and I don't see the problem you mention.

I'm on Mac OS X 11.4. Since Joel in comment 4 is also on Mac, it's possible it's isolated to that platform.

The code handles exiting fullscreen can be found here: https://searchfox.org/mozilla-central/rev/d3683dbb252506400c71256ef3994cdbdfb71ada/layout/base/PresShell.cpp#8468-8491

It seems to me that the code above already tries to prevent default, and also I tried that if I listen to keydown event in a page and invoke preventDefault, the full screen mode wouldn't exit. So there is probably something going wrong somewhere...

I did a quick test on Safari and I am running into the same issues that these changes have introduced to Firefox for. For example, if I preview an Excel file in Gmail in both Safari and Firefox pressing the escape key both closes the Excel preview and exits full screen mode. I am guessing many sites just don't implement the preventDefault because they don't expect there to be a default action bound to the escape key. It seems to me that enough sites implement a periodic functionality with the escape key that the browser should not bind layout changing behavior to the same key. On many sites, I don't know if the escape key will close a modal/overlay or not and having my desktop layout shifted if I guessed wrong or they didn't implement a preventDefault is really frustrating.

If we decide that escape key should not exit full screen mode, then this bug should probably be moved to Widget: Cocoa instead, since it's a platform-specific issue then. I don't think escape would exit full screen mode on Linux or Windows.

It looks like this behavior was added in https://phabricator.services.mozilla.com/D116661 .

See Also: → 1688584
Component: DOM: Events → Widget: Cocoa

I'm seeing the same issue in 92.0b5 and MacOS 11.4. Several sites I frequent use Escape to back out of modals, and having FF exit fullscreen mode when I do that is maddening.

Regressed by: 1688584
See Also: 1688584
Has Regression Range: --- → yes

Set release status flags based on info from the regressing bug 1688584

Whiteboard: [mac:fullscreen]

(In reply to Aki Sasaki [:aki] (he/him) (UTC-6) (back August 23) from comment #2)

Safari appears to perform with the Expected Results: one Esc to exit full screen video, one Esc to exit full screen browser.
Chrome doesn't exit full screen browser mode with Esc, which is also acceptable behavior IMO; you exit full screen video with Esc, and you exit full screen browser with another ctrl-cmd-F.

Are you still experiencing this on Youtube specifically? I just tried and I can't seem to reproduce.

Flags: needinfo?(aki)

As of 20210820095755 Nightly it seems like a single Esc no longer exits full screen on Youtube or Twitter, which is odd, because it looks like your patch only made it to Autoland. Esc does eventually exit full screen, but sometimes I have to press it multiple times, or switch tabs to a different site/page.

Because the double-fullscreen-exit was my pain point, this is better behavior for me, but this may be problematic for people expecting Esc to exit full screen.

Flags: needinfo?(aki)

Ah, a single Esc will still exit full screen video and full screen browser on Tweetdeck.

Severity: -- → S4
Priority: -- → P3

Changing the priority to p1 as the bug is tracked by a release manager for the current beta.
See What Do You Triage for more information

Priority: P3 → P1

The regressing feature was disabled in bug 1726810. Setting the status for Fx93 accordingly.

We are going to turn this feature back on in bug 1732367. However, unlike last time, there will be a way to disable the feature for users whose workflow is broken by flipping the browser.fullscreen.exit_on_escape pref back to false. I'm going to close this bug as WONTFIX, since we are aware that some websites fail to call preventDefault on the key event when they should.

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → WONTFIX

I think this DOM fullscreen issue does not fall under the preventDefault umbrella. According to comment 2, Safari handles this scenario correctly.
And it's Firefox that exits DOM fullscreen when Esc is pressed, not the web page.

Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---

(In reply to Markus Stange [:mstange] from comment #20)

I think this DOM fullscreen issue does not fall under the preventDefault umbrella. According to comment 2, Safari handles this scenario correctly.
And it's Firefox that exits DOM fullscreen when Esc is pressed, not the web page.

I was unable to reproduce the initial bug report (comment 14) and further testing seems to indicate that this no longer reproduces as originally reported (comment 15). Have you been able to reproduce this issue?

Flags: needinfo?(mstange.moz)

Oh, indeed I cannot reproduce the initial problem. Let's close it WORKSFORME then. Do we know what might have fixed it?

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Flags: needinfo?(mstange.moz)
Resolution: --- → WORKSFORME

My best guess is that this was a change on the website's end, somehow falling into the preventDefault category after all. But hard to tell for sure.

(In reply to Stephen A Pohl [:spohl] from comment #23)

My best guess is that this was a change on the website's end, somehow falling into the preventDefault category after all. But hard to tell for sure.

That can't be true. The escape key to exit DOM Fullscreen does not trigger a key event on the page for good reason, and thus the page has no chance to interfere it with prevent default or something like that. It has to be something changed in Firefox or Gecko.

(In reply to Xidorn Quan [:xidorn] UTC+11 from comment #24)

(In reply to Stephen A Pohl [:spohl] from comment #23)

My best guess is that this was a change on the website's end, somehow falling into the preventDefault category after all. But hard to tell for sure.

That can't be true. The escape key to exit DOM Fullscreen does not trigger a key event on the page for good reason, and thus the page has no chance to interfere it with prevent default or something like that. It has to be something changed in Firefox or Gecko.

Okay, I should clarify that I was never able to reproduce the initial problem that was reported in this bug. Even now, trying to use mozregression to find a point when this started happening, or when it stopped happening, yielded no results. It always behaved properly. If bug 1688584 was enabled, we would always first exit DOM fullscreen, then window fullscreen on a second escape key press. If it wasn't enabled, we obviously only ever exited DOM fullscreen. I'm not aware of any other changes that landed in Firefox/Gecko that had anything to do with escape key press handling, so my next best guess was a change on the website's end, which admittedly doesn't make much sense either.

You need to log in before you can comment on or make changes to this bug.