Fullscreen API is banned in all async callbacks

NEW
Unassigned

Status

()

Core
DOM
3 years ago
5 months ago

People

(Reporter: xidorn, Unassigned)

Tracking

(Depends on: 1 bug, {dev-doc-needed})

Trunk
dev-doc-needed
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
With code for example:

element.onclick = function() {
  setTimeout(function() {
    element.requestFullscreen();
  }, 0);
};

the request won't succeed because it is not called during user event handling.

In Chrome, this async delay is allowed up to 1s. I guess the behavior of Chrome is actually what we wanted, or we wouldn't have the timeout checking [1].

https://dxr.mozilla.org/mozilla-central/source/dom/events/EventStateManager.cpp#3620
(Reporter)

Updated

3 years ago
Component: Document Navigation → DOM

Comment 1

3 years ago
That time out check is different. It is about the case if handling user input takes more than X time.
For example if there is a synchronous XHR in the event listener.
Keywords: dev-doc-needed
(Reporter)

Updated

3 years ago
Depends on: 1185052
You need to log in before you can comment on or make changes to this bug.