This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Currently requestPointerLock requires element to be in Document, but Chromium does let one to lock pointer to a shadow dom element too.
There's nothing fundamentally wrong with pointer lock targeting any element. Specifying the element must be in the document easily handles any kind of navigation concerns (where lock must be released) and dismiss any open ended questions about where events are headed if elements aren't in the document. Here are the relevant sections of Pointer Lock: """ 5.1 Methods requestPointerLock ... Pointer lock must succeed only if the target is in the active document of a browsing context which is (or has an ancestor browsing context which is) in focus by a window which is in focus by the operating system's window manager. ... 8 Requirements Pointer lock must be exited if the target is removed from its document, or the user agent, window, or tab loses focus. Moving focus between elements of active documents, including between browsing contexts, does not exit pointer lock. E.g. using the keyboard to move focus between contents of frames or iframes will not exit. """ And here is a draft of a change to add shadow tree/host to the sections: """ 5.1 Methods requestPointerLock ... Pointer lock must succeed only if the target is in the active document (or a shadow tree of a shadow host in the active document) of a browsing context which is (or has an ancestor browsing context which is) in focus by a window which is in focus by the operating system's window manager. ... 8 Requirements Pointer lock must be exited if any of the follow occur: - The target is removed from its document. - The target is removed from its shadow tree. - The user agent, window, or tab loses focus. Moving focus between elements of active documents, including between browsing contexts, does not exit pointer lock. E.g. using the keyboard to move focus between contents of frames or iframes will not exit. """ Review & comments please.
> 5.1 Methods > > requestPointerLock > > ... > > Pointer lock must succeed only if the target is in the active document (or a > shadow tree of a shadow host in the active document) We probably don't want elements in older shadow trees which aren't projected to newer shadow trees to be able to lock the pointer.
Moved to https://github.com/w3c/webcomponents/issues/192