Closed Bug 1928340 Opened 1 year ago Closed 1 year ago

Pointer lock is released unexpectedly when the DevTools panel is closed using F12

Categories

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

defect

Tracking

()

RESOLVED FIXED
134 Branch
Tracking Status
firefox134 --- fixed

People

(Reporter: edgar, Assigned: edgar)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

STR:

  1. Load https://mdn.github.io/dom-examples/pointer-lock/.
  2. Open DevTools panel via F12.
  3. Click the red circle to request pointer lock.
  4. Close DevTools panel via F12.

Expected result:
Pointer is still locked.

Actual result:
Pointer lock is released.

It is because when DevTools panel is closed, the Document::OnPageHide is called when the document of DevTools is destroyed, which calls PointerLockManager::Unlock. And the PointerLockManager::Unlock just unconditionally notify content process to release pointer lock in https://searchfox.org/mozilla-central/rev/783f3fca1dda58353f7d3075744dd48b66e00e5e/dom/base/PointerLockManager.cpp#195-201. In such case, we should not need to ask content to release the pointer lock.

Assignee: nobody → echen
Status: NEW → ASSIGNED
See Also: → 1923207
Pushed by echen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe8b67c873fb Add some log for pointer lock; r=smaug https://hg.mozilla.org/integration/autoland/rev/41eeee000de1 Prevent unexpected pointer lock release from the parent process; r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 134 Branch
Duplicate of this bug: 1923207
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: