User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Build ID: 20111102223350
Steps to reproduce:
Viewing an iframe in DOM full-screen mode pressing the escape key doesn't make it leave fullscreen.
1. Open http://www.thecssninja.com/demo/fullscreen/
2. Click the "Fullscreen iframe" button
3. Click anywhere inside the iframe
4. Now pressing escape has no effect
So the issue here is that if you focus a non-fullscreen frame the key events won't go through the full-screen document's presshell's event handler. We should ensure that ESC *always* exits full-screen, and so check if the root document is full-screen rather than if the focused document is in PresShell::HandleEventInternal().
Created attachment 574195 [details] [diff] [review]
Instead of checking if a keyevent's target document is full-screen, check if the root document is full-screen, and exit if ESC is pressed. This means if ESC is pressed when a non-full-screen iframe which is contained inside a full-screen document is focused, you'll still exit full-screen.
Comment on attachment 574195 [details] [diff] [review]
Requesting approval for Aurora because this bug prevents the a simple way to avoid the "Press ESC to leave full-screen" warning when in full-screen mode. Without this we're vulnerable to phishing.
ESC key works fine now. This is verified fixed on Firefox 10 Beta2:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0
Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20100101 Firefox/10.0
This is verified fixed on Firefox 11b1:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20100101 Firefox/11.0