[webcomponents] [Shadow]: How should Element.requestPointerLock() work in shadow DOM? (bugzilla: 26934) (#192)

Title: [Shadow]: How should Element.requestPointerLock() work in shadow DOM? (bugzilla: 26934)

Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26934

----
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26934#c0
*Olli Pettay* wrote on 2014-09-29 23:47:53 +0000.

Currently requestPointerLock requires element to be in Document, but Chromium
does let one to lock pointer to a shadow dom element too.

----

comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26934#c1
** wrote on 2014-09-30 15:38:41 +0000.

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.

----

comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=26934#c2
*Olli Pettay* wrote on 2014-09-30 15:49:09 +0000.

> 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.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/192

Received on Monday, 6 July 2015 07:38:57 UTC