Open Bug 1654512 Opened 4 years ago Updated 2 years ago

requestFullscreen may result on neither fullscreenchange nor fullscreenerror being dispatched due to race condition

Categories

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

defect

Tracking

()

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Attached file testcase (deleted) —

This is revealed in bug 1489190 after the fullscreen test was re-enabled as part of bug 1350875.

The contract of Fullscreen API is that, when requestFullscreen method is called, either fullscreenchange or fullscreenerror event should be dispatched, indicating it succeeds or fails. Also the promise it returns should also be either resolved or rejected.

However, in case when the child process exits fullscreen and request fullscreen again, while the parent process is still in the process of exiting, sometimes neither of the events is dispatched, breaking the contract.

It can be easily reproduced with the attached testcase with full-screen-api.allow-trusted-requests-only set to false. Open the page with the pref set, it should repeatedly enter fullscreen and exit because we repeat requestFullscreen whenever either of the event happens. However, it gets stuck very soon.

This is probably not very important, as it doesn't seem to drag the document into weird state, only that we leave a promise unresolved forever until document goes away. Also as it requires exit then immediately entering fullscreen, it's unlikely to be hit in normal case at all, as entering fullscreen requires user activation.

Severity: S4 → S3
Priority: P5 → P3

(There are some investigations related to this in bug 1826645.)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: