-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shadow DOM and requestPointerLock() #192
Comments
I don't know yet. I'm not currently sufficiently familiar with Shadow DOM, and in 15 minutes could not understand open/closed trees, and thus do not understand the discussion in #180 for Fullscreen. I also don't fully understand andyearnshaw's fullscreen usecase. From my simplistic understanding, Pointer Lock should work for any node in a tree that can eventually (even through shadow DOM boundaries) reach the root document node of a frame. Permission should be controlled by a single origin. Lock should be exited if the node is no longer in the tree (as above), or navigation, or loss of document focus. Generally, if a shadow node has lock and there's a need to disambiguate that element, the I can contribute more to this discussion after either finding more time to learn Shadow DOM or by answering more specific questions Shadow DOM folk have. |
@scheib the principle we try to follow is that the "light tree" cannot know about the existence of the "shadow tree". (There's a couple of exceptions to that rule, but not for normal APIs such as Fullscreen and Pointer Lock, most likely. That's why Looking over https://w3c.github.io/pointerlock/ I guess the additional complication for Pointer Lock beyond what Fullscreen has is event retargeting and what that means for movementX/Y. |
OK, so the goal is that when a shadow node acquires lock the light tree should be ignorant. Then I would suggest
I don't fully understand the shadow tree document structure. Does each tree have a document, or is the document a mix of trees? Presuming the later, these are needed:
I don't think changes are needed for:
|
Thank you, that seems pretty reasonable to me. There's no rush for Pointer Lock to move first here. I'll ping this thread when some other features have started accounting for shadow trees. |
It looks okay, however, DocumentOrShadowRoot is the place where pointerlockElement, onpointerlockchange, onpointerlockerror, exitPointerLock should be defined. You can use this mixin, instead of Document, in the Pointer Lock spec. |
I have merged #180 into this issue. If you need help, I think we are happy to help you. |
Now this is detached from #180 again, but it is quite similar in API surface.
@scheib does this look good to you? |
Thank you, I agree with these, as we discussed in person. |
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to 'shadow-including document' where necessary.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
See discussion about this change at: WICG/webcomponents#192 Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. Fixes w3c#3.
Splits Document.pointerLockElement into Document.pointerLockElement and ShadowRoot.pointerLockElement and encapsulates shadow tree from document. Other than split, replaces document to use Shadow DOM-aware vocabulary like 'shadow-including root' where necessary. See discussion about this change at: WICG/webcomponents#192 And the pull request at: #4 Fixes #3.
The spec working draft is updated to include the conclusion here. @hayatoito could you close this? |
This corresponds to the spec change for WICG/webcomponents#192
This corresponds to the spec change for WICG/webcomponents#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:
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.
The text was updated successfully, but these errors were encountered: