Bug 114530 - requestFullscreen on the current fullscreen element should fire fullscreen error.
Summary: requestFullscreen on the current fullscreen element should fire fullscreen er...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL: https://github.com/GoogleChrome/chrom...
Keywords:
: 114767 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-12 13:21 PDT by Jer Noble
Modified: 2022-09-12 09:19 PDT (History)
9 users (show)

See Also:


Attachments
Patch (7.08 KB, patch)
2013-04-17 14:25 PDT, Jer Noble
bfulgham: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2013-04-12 13:21:25 PDT
Cloned from <http://code.google.com/p/chromium/issues/detail?id=229803>:

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1472.0 Safari/537.36

Steps to reproduce the problem:
1. Install the Window State example from the chrome-app-samples repo (https://github.com/GoogleChrome/chrome-app-samples/tree/master/window-state ) 
2. Launch it, then "Enter" next to HTML5 fullscreen
3. (App goes fullscreen) Click "Enter" again
4. Click "Exit"

What is the expected behavior?
App stops being fullscreen

What went wrong?
App stays fullscreen. Clicking "Exit" again will cause it to stop being fullscreen. You have to press "Exit" as many times as you've pressed "Enter". (These buttons are just calling webkitRequestFullscreen and webkitExitFullscreen respectively.)

WebStore page: 

Did this work before? No 

Chrome version: 28.0.1472.0  Channel: canary
OS Version: OS X 10.7.5
Comment 1 Jer Noble 2013-04-12 13:22:04 PDT
schieb@chromium.org commented <http://code.google.com/p/chromium/issues/detail?id=229803#c3> in the original bug:

"This is an error in WebKit & Blink (likely in Document.cpp), and not apps specific. Load https://github.com/GoogleChrome/chrome-app-samples/blob/master/window-state/window.html in Chrome and the same behavior exists.

The fullscreen specification https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html does express this as an error, in:
- requestFullscreen() method must run these steps:
- If any of the following conditions are true, ... fullscreenerror:
  - "The context object's node document fullscreen element stack is not empty and its top element is not an ancestor of the context object."

In this case, the element is already fullscreen and the top of the stack, the element is not an ancestor of its self.


A work around is for an application to check document.webkitFullscreenElement before requesting fullscreen, so as to not make the same element fullscreen multiple times."
Comment 2 Jer Noble 2013-04-17 14:17:23 PDT
*** Bug 114767 has been marked as a duplicate of this bug. ***
Comment 3 Jer Noble 2013-04-17 14:25:23 PDT
Created attachment 198612 [details]
Patch
Comment 4 Brent Fulgham 2014-04-24 10:30:46 PDT
Comment on attachment 198612 [details]
Patch

r=me.
Comment 5 Ahmad Saleem 2022-09-12 09:18:52 PDT
This r+ patch didn't landed and I was not able to find reference to this code in Webkit GitHub (might be searching wrong).

Can anyone else see whether it is still an issue or need to be fixed or this is taken care of? Thanks!