Re: [w3c/pointerlock] Add lock options to requestPointerLock (#49)

@JamesHollyer commented on this pull request.

Thanks again.  Can you find any other things that need fixing?

> -        technologies like screen magnifiers.
-      </p>
+      <section>
+        <h3>
+          The <dfn>pointer lock state</dfn> Definition
+        </h3>
+          <p><a>Pointer lock state</a> is the state where a single DOM element, which
+            we will call the <dfn>pointer-lock target</dfn>, receives all mouse events and the cursor
+            is hidden.</p>
+          <p>
+            Once in the <a>pointer lock state</a> the <a>user agent</a> has a
+            <a>pointer-lock target</a>, a <dfn>pointer-lock options</dfn>, which is a <a>PointerLockOptions</a> and, a
+            <dfn>cursor position</dfn> which is a pair of numbers representing the location of the system mouse
+            cursor when the Pointer Lock State was entered(the same location that is reported in <code>screenX</code>,
+            <code>screenY</code>). The <a>pointer-lock target</a> must receive all relevant user generated {{MouseEvent}}
+            events. The <a>pointer-lock target</a> will receive all `mousemove`, `mousedown`, `mouseup`, `click`, `dblclick`,

That is correct.

> +            <a>pointer lock state</a>. Events that require the concept of a mouse cursor must not be dispatched. The events
+            `mouseenter`, `mouseleave`, `mouseover`, `mouseout`, `drag`, and `drop` will not be dispatched.

Any target.  I combined the sentences.

> -            mouse events to other elements. Events that require the concept of
-            a mouse cursor must not be dispatched (for example: `mouseover`,
-            `mouseout`, `drag`, and `drop`).
-          </p>
-          <p>
-            In the locked state the system mouse cursor must be hidden.
-            Movement and button presses of the mouse must not cause the window
-            to lose focus.
-          </p>
-          <p>
-            Synthetic mouse events created by application script act the same
-            regardless of lock state.
+            Perform the following steps:
+            <ol>
+              <li>
+                Return a <a href="https://heycam.github.io/webidl/#idl-promise">Promise</a></li>

Done.

> +                focus by the operating system's window manager:
+                <ol>
+                  1. <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-an-element-task">
+                  Queue an element task</a> on the 
+                  <a href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source">
+                  user Interaction task source</a>, given this, to perform the following steps:
+                  <ol>
+                    <li>
+                      <a href=https://dom.spec.whatwg.org/#concept-event-fire">Fire an event</a> named
+                      <a>pointerlockerror</a> at <a>this</a>'s 
+                      <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>.
+                    </li>
+                    <li>
+                      <a>Reject</a> the promise with a "{{WrongDocumentError}}" {{DOMException}}.
+                    </li>
+                  </ol>

I added return promise to all sections that Queue an element task. and Changed references to "the promise to explicitly reference the promise in the initial step.

> +                        </li>
+                        <li>
+                          <a>Reject</a> the promise with a "{{NotSupportedError}}" {{DOMException}}.
+                        </li>
+                      </ol>
+                    </ol>
+                  </li>
+                  <li>
+                    If <a>options</a> are not equivalent to the current <a>pointer-lock options</a> and 
+                    <a>options</a> are supported then perform the following steps
+                    <ol type='i'>
+                      <li>
+                        The user agent's <a>pointer-lock target</a> must be updated to this element
+                      </li>
+                      <li>
+                        The user agent's <a>pointer-lock target</a> must be updated to this element

oops.  Removed

> +                  </li>
+                  <li>
+                    If <a>options</a> are not equivalent to the current <a>pointer-lock options</a> and 
+                    <a>options</a> are supported then perform the following steps
+                    <ol type='i'>
+                      <li>
+                        The user agent's <a>pointer-lock target</a> must be updated to this element
+                      </li>
+                      <li>
+                        The user agent's <a>pointer-lock target</a> must be updated to this element
+                      </li>
+                      <li>
+                        The current <a>pointer-lock options</a> must be updated to <a>options</a>
+                      </li>
+                      <li>
+                        a <a>pointerlockchange</a> event must be sent

Done.

> +                        The current <a>pointer-lock options</a> must be updated to <a>options</a>
+                      </li>
+                      <li>
+                        a <a>pointerlockchange</a> event must be sent
+                      </li>
+                      <li>
+                        the promise must <a>resolve</a>
+                      </li>
+                    </ol>
+                  </li>
+                </ol>
+              </li>
+              <li>
+                If any element (including this one), whose <a>shadow-including
+                root</a> is same as this element's <a>shadow-including root</a> and, is
+                already locked (or pending lock) then perform the following steps

Done.

> @@ -331,18 +609,15 @@ <h2>
           <dfn>exitPointerLock()</dfn> method
         </dt>
         <dd>
-          <p>
-            Initiates an exit from pointer lock state if currently locked to a
-            target whose <a>shadow-including root</a> is this document, and
-            sends a <a>pointerlockchange</a> event when the lock state has been
-            exited.
-          </p>
-          <p>
-            The system mouse cursor must be displayed again and positioned at
-            the same location that it was when pointer lock was entered (the
-            same location that is reported in <code>screenX</code>,
-            <code>screenY</code>, when the pointer is locked).
-          </p>
+          <ol>
+            <li>

Added.

> -            target whose <a>shadow-including root</a> is this document, and
-            sends a <a>pointerlockchange</a> event when the lock state has been
-            exited.
-          </p>
-          <p>
-            The system mouse cursor must be displayed again and positioned at
-            the same location that it was when pointer lock was entered (the
-            same location that is reported in <code>screenX</code>,
-            <code>screenY</code>, when the pointer is locked).
-          </p>
+          <ol>
+            <li>
+              If <a>pointer-lock target</a> is not in the same <a>shadow-including root</a> as <a>this</a>'s document, return.
+            </li>
+            <li>
+              if currently locked to a target whose <a>shadow-including root</a> is this document <a>exit pointer lock</a>

Done.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/pointerlock/pull/49#pullrequestreview-507810431

Received on Wednesday, 21 October 2020 23:50:48 UTC