Skip to content

Commit

Permalink
Update for Shadow DOM
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TakayoshiKochi committed Jun 27, 2016
1 parent a56c669 commit 4dad448
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ <h2>Extensions to the <a>Element</a> Interface</h2>
active sandboxing flag set</a> does not have the <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#sandboxed-pointer-lock-browsing-context-flag">
sandboxed pointer lock browsing context flag</a> set.

<p>Pointer lock must succeed only if the <a>target</a> is
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#in-a-document">in</a>
the
<p>Pointer lock must succeed only if the <a>target</a>'s
<a href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</a>
is the
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#active-document">active document</a>
of a
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#browsing-context">browsing context</a>
Expand Down Expand Up @@ -275,12 +275,13 @@ <h2>Extensions to the <a>Element</a> Interface</h2>
for a subsequent requestPointerLock.
</p>

<p>If any element (including this one) in the same document
<p>If any element (including this one) in the same shadow-including document
is already locked (or pending lock) the pointer
lock <a>target</a> must be updated to this element and a
<a>pointerlockchange</a> event sent.</p>

<p>If any element in another document is already locked the request
<p>If any element whose <a href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</a> is a different document
is already locked the request
must fail and a <a>pointerlockerror</a> event be sent.</p>

<p>Once in the locked state the <a>user agent</a> must fire all relevant
Expand Down Expand Up @@ -322,21 +323,12 @@ <h2>Extensions to the <a>Document</a> Interface</h2>
for <a>pointerlockerror</a> events.</p>
</dd>

<dt>readonly attribute Element? pointerLockElement</dt>
<dd>
<dfn title="pointerLockElement"></dfn>

<p>Returns the element set as the <a>target</a> for mouse events
while the pointer is locked. Null if lock is pending, pointer is
unlocked, or if the target is in another document.</p>
</dd>

<dt>void exitPointerLock ()</dt>
<dd>
<dfn title="exitPointerLock"></dfn>

<p>Initiates an exit from pointer lock state if currently locked
to a target in this document,
to a target whose <a href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</a> is this document,
and sends a <a>pointerlockchange</a> event when the lock state
has been exited.</p>

Expand All @@ -348,6 +340,24 @@ <h2>Extensions to the <a>Document</a> Interface</h2>
</dl>
</section>

<section>
<h2>Extensions to the <a>DocumentOrShadowRoot</a> Mixin</h2>

<dl title='partial interface DocumentOrShadowRoot' class='idl'>
<dt>readonly attribute Element? pointerLockElement</dt>
<dd>
<dfn title="pointerLockElement"></dfn>

<p>Returns the result of the
<a href="https://w3c.github.io/webcomponents/spec/shadow/#dfn-retargeting-algorithm">retargeting algorithm</a>
with the <a href="http://dom.spec.whatwg.org/#context-object">context object</a>
and the element set as the <a>target</a> for mouse events
while the pointer is locked. Null if lock is pending, pointer is
unlocked, or if the target's <a href="https://dom.spec.whatwg.org/#concept-shadow-including-root">shadow-including root</a> is a different document.</p>
</dd>
</dl>
</section>

<section>
<h2>Extensions to the <a>MouseEvent</a> Interface</h2>

Expand Down Expand Up @@ -430,7 +440,8 @@ <h2>Requirements</h2>
[[FULLSCREEN]].</p>

<p>Pointer lock must be exited if the
<a>target</a> is removed from its document, or the <a>user agent</a>,
<a>target</a> is <a href="https://html.spec.whatwg.org/#node-is-disconnected">disconnected</a>,
or the <a>user agent</a>,
window, or tab loses focus. Moving focus between elements of
<a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#active-document">active documents</a>,
including between
Expand Down

0 comments on commit 4dad448

Please sign in to comment.