Open Bug 1830143 Opened 1 year ago Updated 1 year ago

In testing, ScreenOrientation lock requests are rejected during async fullscreen transitions

Categories

(Core :: DOM: Device Interfaces, defect)

defect

Tracking

()

People

(Reporter: bradwerth, Unassigned)

References

Details

ScreenOrientation::GetLockOrientationPermission rejects if the document is hidden. In tests where a lock request immediately follows a fullscreen request, such as wpt lock-basic.html, an async fullscreen request will fulfill its promise before the transition is complete and before the document's visibility state has been updated. This tight timing causes the promise to be rejected which causes the test to fail.

Possible fixes:

  1. Ignore this problem. It only shows up in testing and wouldn't affect users. We'd have to update the test expectations to something like [PASS, FAIL] which is quite unsatisfying.
  2. Allow the lock to succeed by modifying the permission check to detect when the document is hidden but on its way to being fullscreen. In other words, allow it to succeed as long as the fullscreen transition has begun. We'd have to be careful here to still reject the promise when the document is hidden and already in fullscreen.

I'll see if I can put a patch together.

I don't see an easy fix. I'm going to take myself off this Bug, update the test expectations in Bug 1802193 (which was the motivating case of making macOS fullscreen transitions async) and add a comment in the meta ini file back to this Bug.

Assignee: bwerth → nobody
No longer blocks: 1802193
Component: Widget: Cocoa → DOM: Device Interfaces
See Also: → 1802193
Severity: S3 → S4
You need to log in before you can comment on or make changes to this bug.