Closed Bug 1144964 Opened 10 years ago Closed 9 years ago

Clicks on Fullscreen prompt UI affect the page

Categories

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

24 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: azakai, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

In the attached testcase (opened using localhost, served on python -m SimpleHTTPServer), one click on the canvas should go to fullscreen, and another click exit. Then it should print on the page that the test passed. On firefox, if the fullscreen prompt ("allow this page" etc.) appears, then clicking on it exits fullscreen. This is surprising as clicking on the browser UI to agree to fullscreen should not affect the page in any way (either the browser just exits fullscreen directly, or it is sending an event to the page for the click on the UI, neither of which should happen). This makes the test fail. If the user has already agreed to always allow that site to enter fullscreen, then the test passes, as no prompt is shown. On chrome, the test passes even if the prompt is shown, as expected.
Attached file testcase html (deleted) —
testcase html (from emscripten's interactive.test_sdl2_togglefullscreen test)
Attached file testcase js (deleted) —
Blocking gecko-games as this potentially affects any fullscreen-using game using emscripten SDL2 (like Humble Bundle).
Blocks: gecko-games
More specifically, what happens is clicking to allow fullscreen on the browser's fullscreen prompt ends up issuing a blur event. This seems wrong - nothing is being blurred? And the user has interacted with a browser prompt, not the page itself. What then happens on that testcase is that the page sees the blur, and assumes the user left the page, so it requests a cancel of fullscreen.
One problem here is that the full screen confirmation deny/allow prompt causes blur and focus events to be received after pressing allow. SDL 2 reacts as if the user switched to another program and exits full screen mode in response. I'm attaching a small test which shows those events in the web console. I think that the prompt shouldn't cause blur because the user did not switch away. I notice that Firefox also sends blur during modal dialogs such as window.alert(), so maybe this is intentional in Firefox? Webkit stopped blur for modal dialogs: https://bugs.webkit.org/show_bug.cgi?id=33962 Another problem is that buttons in the full screen confirmation dialog perform the requested action immediately on a mouse press. The mouseup event then gets delivered to the page. Typically buttons in a GUI only visually appear pressed when you press them, and only perform their action when the mouse is released. This only happens in the big test attached by Alon Zakai, and not in the simple test I just attached. Maybe use of WebGL there is causing it to act differently?
Xidorn recently did some work on fullscreen functionality; maybe he has thoughts.
Flags: needinfo?(quanxunzhen)
I believe this should have been fixed as we no longer require user's action to enter fullscreen since bug 1160017. I didn't try the testcase, though, so feel free to reopen if this is still an issue.
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(quanxunzhen)
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: