Closed Bug 948268 Opened 6 years ago Closed 6 years ago

cant exit fullscreen programatically

Categories

(Core :: DOM: Core & HTML, defect)

25 Branch
x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: jorgejaramillo1, Assigned: emk)

References

Details

(Keywords: APIchange, ue)

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce:

I have a page where the user can exit fullscreen with button, or the application can exit fullscreen.
The application tries to exit fullscreen by calling cancelFullscreen.
In the example attached, the app can exit fullscreen by itself after 2 seconds of entering fullscreen.


Actual results:

The application calls the fullscreen API, but it is ignored.


Expected results:

firefox should exit fullscreen when the app requests it.
Keywords: APIchange, ue
According to the Fullscreen spec, exitFullscreen() doesn't check if the algorithm is allowed to show a popup.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Do the obvious.
Attachment #8345851 - Flags: review?(cpearce)
Attached patch Fixup the testSplinter Review
I'll fold this on landing.
Attachment #8346215 - Flags: review?(cpearce)
Comment on attachment 8345851 [details] [diff] [review]
bug948268_exitfullscreen

Review of attachment 8345851 [details] [diff] [review]:
-----------------------------------------------------------------

I think this is a good idea. This effect can already be achieved by removing the fullscreen element from the document; removing the fullscreen element from its document exits fullscreen.

This is also the behaviour that Chrome has, testcase: http://pearce.org.nz/f press "Toggle fullscreen" button, then "Delay cancel" button, Chrome exits fullscreen, we don't.

I would like to get more people to OK this though, so requesting feedback from Olli and Bz.
Attachment #8345851 - Flags: review?(cpearce)
Attachment #8345851 - Flags: review+
Attachment #8345851 - Flags: feedback?(bzbarsky)
Attachment #8345851 - Flags: feedback?(bugs)
Attachment #8346215 - Flags: review?(cpearce) → review+
So what happens if a web page enters and exits fullscreen in a loop?
(In reply to Olli Pettay [:smaug] from comment #5)
> So what happens if a web page enters and exits fullscreen in a loop?

It's impossible because entering fullscreen still requires the privilege.
But if you do enterFullScreen(), exitFullScreen() in a loop.
We're handling user input so entering fullscreen should succeed.


(Just want to understand the behavior we get and what behavior we want.)
Comment on attachment 8345851 [details] [diff] [review]
bug948268_exitfullscreen

This seems fine to me, given that it doesn't actually add new capabilities given the element-removing setup...
Attachment #8345851 - Flags: feedback?(bzbarsky) → feedback+
(In reply to Olli Pettay [:smaug] from comment #7)
> But if you do enterFullScreen(), exitFullScreen() in a loop.
> We're handling user input so entering fullscreen should succeed.
> 
> 
> (Just want to understand the behavior we get and what behavior we want.)

Currently exitFullScreen() will do the same check as enterFullScreen(). If enterFullScreen() succeeds for any reason, exitFullScreen() will also succeed. So this change will make nothing worse.
Comment on attachment 8345851 [details] [diff] [review]
bug948268_exitfullscreen

indeed
Attachment #8345851 - Flags: feedback?(bugs) → feedback+
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/be5f5ca171f0
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Duplicate of this bug: 867967
You need to log in before you can comment on or make changes to this bug.