requestFullscreen denied from select onchange handler
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | verified |
People
(Reporter: graham, Assigned: edgar)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Steps to reproduce:
Attempting to go full screen from a pulldown like this:
<select onchange="document.body.requestFullscreen()">
<option value="none">Do nothing</option>
<option value="full">Full screen</option>
</select>
Actual results:
This message appears in the console:
Request for fullscreen was denied because Element.requestFullscreen() was not called from inside a short running user-generated event handler.
The browser does not go full screen.
Expected results:
The browser should have gone full screen. The request WAS "called from inside a short running user-generated event handler".
This works in Chromium (71.0.3578.98).
Putting requestFullscreen
in the option's click handler is also denied with the same message.
Putting the request in a button's click handler works correctly.
This bug might help locate the part of the code to fix: https://bugzilla.mozilla.org/show_bug.cgi?format=default&id=966493 . It refers to the same problem but with touch events.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Johann, could this be related to the recent user interaction API blocking changes?
Comment 2•6 years ago
|
||
Unlikely that this is related to our work. We did not change (and definitely not remove) places where user interaction is initiated. Maybe the onchange event is just separately dispatched and thus doesn't get the same user input stack? Smaug, can you take a look at this?
Considering that we want to use user interaction more extensively we should probably try to match Chrome's behavior here.
Graham, is this a regression (does it work in older release of Firefox, e.g. with https://mozilla.github.io/mozregression/)? Also, does this work if you try a handling a different event type on the select element?
Thanks!
Reporter | ||
Comment 3•6 years ago
|
||
is this a regression
I don't know, I don't have access to an older Firefox. I do know that it doesn't work in Edge 38 or Safari either.
does this work if you try a handling a different event type on the select element?
No. <select onclick="document.body.requestFullscreen()">
is also denied with the same message.
This smells like an issue with e10s select. I don't recall where we set the flag in that case that we're dealing with user input.
Comment 5•6 years ago
|
||
Here's where we fire the change event:
Perhaps we need to add a setHandlingUserInput RAII to this block where we're firing events?: https://searchfox.org/mozilla-central/rev/75294521381b331f821aad3d6b60636844080ee2/dom/interfaces/base/nsIDOMWindowUtils.idl#1733-1740
Updated•6 years ago
|
Assignee | ||
Comment 6•5 years ago
|
||
We allow open popup with e10s select, the popup state was pushed in https://searchfox.org/mozilla-central/rev/f4c39907e0b527dc4b9356a1eeb8c6e6c62d383a/dom/events/EventListenerManager.cpp#1149-1150.
Perhaps we need to handle IsHandlingUesrInput flag here as well?
Comment hidden (obsolete) |
Assignee | ||
Comment 8•5 years ago
|
||
We have a similar issue on the input date, like
<input type="date" onchange="document.body.requestFullscreen()">
Assignee | ||
Comment 9•5 years ago
|
||
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
For the case like e10s select and input date, etc.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 12•5 years ago
|
||
PresShell::EventHandler::HandleEventWithCurrentEventInfo is the only possible
place will do such handling; other places pass either a nullptr or a
non-MouseDown/Up event.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 15•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 16•5 years ago
•
|
||
Comment 17•5 years ago
|
||
Comment 18•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/750e3e013c4c
https://hg.mozilla.org/mozilla-central/rev/ffc50cffcf1e
https://hg.mozilla.org/mozilla-central/rev/febbc0b025c5
https://hg.mozilla.org/mozilla-central/rev/81792a8b6423
Reporter | ||
Comment 19•5 years ago
|
||
Fedora has Firefox 69 now, and I can confirm this is fixed. Thanks!
Updated•5 years ago
|
Updated•5 years ago
|
Description
•