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

@domenic commented on this pull request.

The model is looking very solid now. What remains are details of the algorithm flow, plus a good deal of editorial nits. (I would encourage you to do a once-over of the PR for grammar/spelling/capitalization consistency.)

But since the model is solid, those changes should be relatively easy. Hooray!

> -        pointer lock is initiated, the magnification software needs to switch
-        to using the keyboard to move the magnified point of focus around
-        instead. When a pointerlockchange event is fired, web browsers
-        therefore need to make sure the event is communicated to assistive
-        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

```suggestion
            <a>pointer-lock target</a>, a <dfn>pointer-lock options</dfn>, which is a <a>PointerLockOptions</a> and a
```

> -        instead. When a pointerlockchange event is fired, web browsers
-        therefore need to make sure the event is communicated to assistive
-        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>,

```suggestion
            cursor when the Pointer Lock State was entered (the same location that is reported in <code>screenX</code>,
```

> -        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`,

```suggestion
            events: namely, all user-generated `mousemove`, `mousedown`, `mouseup`, `click`, `dblclick`,
```

Right? I.e. these two sentences are saying similar things, not two separate things.

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

Again, these two sentences should be merged, I think.

Is the intention that they must not be dispatched on any target, or just on the pointer-lock target?

> +          therefore need to make sure the event is communicated to assistive
+          technologies like screen magnifiers.
+        </p>
+      </section>
+      <section>
+        <h3><dfn>Exit Pointer Lock</dfn></h3>
+        <p>
+          The process of exiting pointer lock, given an element, is as follows:
+          <ol>
+            <li>
+              The system mouse cursor must be displayed again and positioned at <a>cursor position</a>
+            </li>
+            <li>
+              <a href="https://html.spec.whatwg.org/multipage/webappapis.html#queue-an-element-task">
+                Queue an element task</a>, given this element, on the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source">
+                  User Interaction task source</a> to do the following:

```suggestion
                  user Interaction task source</a> to do the following:
```

> +              Exit the <a>Pointer Lock State</a> by setting <a>Pointer-lock target</a>, <a>PointerLockOptions</a>
+              and, <a>cursor position</a> to null.

```suggestion
              Exit the <a>pointer lock state</a> by setting <a>pointer-lock target</a>, <a>pointer-lock options</a>,
              and <a>cursor position</a> to null.
```

>        </p>
       <pre class="idl">
         partial interface Element {
-          void requestPointerLock();
+          Promise&lt;void> requestPointerLock(optional PointerLockOptions options = {});

```suggestion
          Promise&lt;undefined> requestPointerLock(optional PointerLockOptions options = {});
```

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

You can't return in step 1; then the rest of the algorithm will not run!

Instead, you want step 1 to be

> 1. Let _promise_ be [a new promise](https://heycam.github.io/webidl/#a-new-promise).

and then all future steps should refer to _promise_, instead of referring to "the promise".

Then, you add a step at the end of the algorithm which does

> 10. Return _promise_.

> +                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 think you need to add "2. Return _promise_." as a sibling of "1. Queue an element task...". Otherwise the algorithm will continue onward, potentially queuing multiple tasks for different error conditions, or even queuing both error and success conditions. (Same for all other "Queue an element task" sections.

> +            Perform the following steps:
+            <ol>
+              <li>
+                Return a <a href="https://heycam.github.io/webidl/#idl-promise">Promise</a></li>
+              </li>
+              <li>
+                If the <a href="https://heycam.github.io/webidl/#this">this</a>'s
+                <a>shadow-including root</a> is the <a>active document</a> of a
+                [=Document/browsing context=] which is (or has an <a>ancestor
+                browsing context</a> which is) in focus by a window which is in
+                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:

```suggestion
                  user interaction task source</a>, given this, to perform the following steps:
```

> +                      <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>
+                </ol>
+              </li>
+              <li>
+                If the user agent's <a>pointer-lock target</a> is an element whose <a>shadow-including root</a> is
+                not equal to <a>this</a>'s <a>shadow-including root</a>, then:
+                <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:

```suggestion
                  user interaction task source</a>, given this, to perform the following steps:
```

> +                  User Interaction task source</a>, given this, to perform the following steps:
+                  <ol type='i'>
+                    <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 "{{InvalidStateError}}" {{DOMException}}.
+                    </li>
+                  </ol>
+                </ol>
+              </li>
+              <li>
+                If the user agent's <a>pointer-lock target</a>'s <a>shadow-including
+                root</a> is equal to <a>this</a>'s <a>shadow-including root</a> follow these steps:

```suggestion
                root</a> is equal to <a>this</a>'s <a>shadow-including root</a>, then:
```

> +                    </li>
+                  </ol>
+                </ol>
+              </li>
+              <li>
+                If the user agent's <a>pointer-lock target</a>'s <a>shadow-including
+                root</a> is equal to <a>this</a>'s <a>shadow-including root</a> follow these steps:
+                <ol>
+                  <li>
+                    If <a>options</a> are equivalent to the current <a>pointer-lock options</a> then the <a>pointer-lock target</a>
+                    must be updated to this element, a <a>pointerlockchange</a>
+                    event sent, and the promise must <a>resolve</a>.
+                  </li>
+                  <li>
+                    If <a>options</a> are not equivalent to the user agent's current
+                    <a>pointerLockOptions</a> and <a>options</a> are not supported:

```suggestion
                    <a>pointer-lock options</a> and <a>options</a> are not supported:
```

> +                If the user agent's <a>pointer-lock target</a>'s <a>shadow-including
+                root</a> is equal to <a>this</a>'s <a>shadow-including root</a> follow these steps:
+                <ol>
+                  <li>
+                    If <a>options</a> are equivalent to the current <a>pointer-lock options</a> then the <a>pointer-lock target</a>
+                    must be updated to this element, a <a>pointerlockchange</a>
+                    event sent, and the promise must <a>resolve</a>.
+                  </li>
+                  <li>
+                    If <a>options</a> are not equivalent to the user agent's current
+                    <a>pointerLockOptions</a> and <a>options</a> are not supported:
+                    <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:

```suggestion
                      user interaction task source</a>, given this, to perform the following steps:
```

> +                        </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

This step is a dupe of the previous

> +                          <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 "{{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

```suggestion
                        Update the user agent's <a>pointer-lock target</a> to this element.
```

> +                        </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
+                      </li>
+                      <li>
+                        The current <a>pointer-lock options</a> must be updated to <a>options</a>

```suggestion
                        Update the user agent's <a>pointer-lock options</a> to <a>options</a>
```

> +                  </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

"an event must be sent" isn't how you send events. Instead, you need to queue an element task with the two nested steps, just like you do for pointerlockerror.

> +                      <ol type='i'>
+                        <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 "{{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'>

```suggestion
                    <ol>
```

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

I think this step is better phrased as something like

> If the user agent's current pointer-lock target's shadow-including root is the same as this element's shadow-including root, then:

> +                    a <a>pointerlockchange</a> event must be sent
+                  </li>
+                  <li>
+                    the promise must <a>resolve</a>
+                  </li>
+                </ol>
+              </li>
+              <li>
+                If the request was not started from an <a>engagement gesture</a> and 
+                the Document has not previously released a successful Pointer Lock with 
+                {{Document/exitPointerLock()}}:
+                <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:

```suggestion
                  user interaction task source</a>, given this, to perform the following steps:
```

> +                    Pointer lock is commonly combined with fullscreen [[FULLSCREEN]],
+                    and if an <a>engagement gesture</a> is used to enter fullscreen
+                    it is sufficient for a subsequent {{Element/requestPointerLock()}}.
+                  </p>
+                </aside>
+              </li>
+              <li>
+                If <a>this</a>'s <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>'s
+                <a data-cite="html/origin.html#active-sandboxing-flag-set">active
+                sandboxing flag set</a> has the <a>sandboxed pointer lock browsing
+                context flag</a> set:
+                <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:

```suggestion
                  user interaction task source</a>, given this, to perform the following steps:
```

> +                  </ol>
+                </dl>
+                <aside class="note" data-link-for="Document">
+                  "{{NotSupportedError}}" {{DOMException}} should be reserved for 
+                  unsupported options in future iterations of this spec. That is,
+                  no other error conditions should use "{{NotSupportedError}}", so
+                  that web developers can use it for feature testing.
+                </aside>
+              </li>
+              <li>
+                <dl data-dfn-for="PointerLockOptions" data-link-for=
+                "PointerLockOptions">
+                  If none of the above errors have occured
+                  <ol>
+                    <li>
+                      Enter <a>pointer lock state</a> by performing the following

```suggestion
                      Enter <a>pointer lock state</a> by performing the following:
```

> +                  unsupported options in future iterations of this spec. That is,
+                  no other error conditions should use "{{NotSupportedError}}", so
+                  that web developers can use it for feature testing.
+                </aside>
+              </li>
+              <li>
+                <dl data-dfn-for="PointerLockOptions" data-link-for=
+                "PointerLockOptions">
+                  If none of the above errors have occured
+                  <ol>
+                    <li>
+                      Enter <a>pointer lock state</a> by performing the following
+                    </li>
+                    <ol>
+                      <li>
+                        set the user agent's <a>pointer-lock target</a> to the requesting element

```suggestion
                        Set the user agent's <a>pointer-lock target</a> to <a>this</a>.
```

> +                </aside>
+              </li>
+              <li>
+                <dl data-dfn-for="PointerLockOptions" data-link-for=
+                "PointerLockOptions">
+                  If none of the above errors have occured
+                  <ol>
+                    <li>
+                      Enter <a>pointer lock state</a> by performing the following
+                    </li>
+                    <ol>
+                      <li>
+                        set the user agent's <a>pointer-lock target</a> to the requesting element
+                      </li>
+                      <li>
+                        set the user agent's <a>cursor position</a> to the current system mouse location.

```suggestion
                        Set the user agent's <a>cursor position</a> to the current system mouse location.
```

> +                <dl data-dfn-for="PointerLockOptions" data-link-for=
+                "PointerLockOptions">
+                  If none of the above errors have occured
+                  <ol>
+                    <li>
+                      Enter <a>pointer lock state</a> by performing the following
+                    </li>
+                    <ol>
+                      <li>
+                        set the user agent's <a>pointer-lock target</a> to the requesting element
+                      </li>
+                      <li>
+                        set the user agent's <a>cursor position</a> to the current system mouse location.
+                      </li>
+                      <li>
+                        set the <a>pointer-lock options</a>, to <a>options</a>.

```suggestion
                        Set the <a>pointer-lock options</a> to <a>options</a>.
```

> +                    <ol>
+                      <li>
+                        set the user agent's <a>pointer-lock target</a> to the requesting element
+                      </li>
+                      <li>
+                        set the user agent's <a>cursor position</a> to the current system mouse location.
+                      </li>
+                      <li>
+                        set the <a>pointer-lock options</a>, to <a>options</a>.
+                      </li>
+                    </ol>
+                    <li>
+                      <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:

```suggestion
                      user interaction task source</a>, given this, to perform the following steps:
```

> +                      <li>
+                        set the user agent's <a>pointer-lock target</a> to the requesting element
+                      </li>
+                      <li>
+                        set the user agent's <a>cursor position</a> to the current system mouse location.
+                      </li>
+                      <li>
+                        set the <a>pointer-lock options</a>, to <a>options</a>.
+                      </li>
+                    </ol>
+                    <li>
+                      <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 type='i'>

```suggestion
                      <ol>
```

> @@ -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>
+              If <a>pointer-lock target</a> is not in the same <a>shadow-including root</a> as <a>this</a>'s document, return.

```suggestion
              If <a>pointer-lock target</a>'s <a>shadow-including root</a> is not equal to <a>this</a>'s <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a>, return.
```

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

I think you need a step for what happens if people call exitPointerLock() when you're currently not in a pointer lock. Something like

> 1. If the user agent's pointer-lock target is null, then return.

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

The "If" here is unnecessary, since you early-returned when it doesn't hold. So I think just `<a>Exit pointer lock</a> with the user agent's <a>pointer-lock target</a>.` suffices.

> @@ -511,7 +786,7 @@ <h2>
       </h2>
       <p>
         A <dfn>default unlock gesture</dfn> must always be available that will
-        exit pointer lock.
+        <a>exit pointer lock</a> with the User Agent's <a>pointer-lock target</a>.

```suggestion
        <a>exit pointer lock</a> with the user agent's <a>pointer-lock target</a>.
```

> @@ -729,7 +1004,7 @@ <h2>
         calls.
         </li>
         <li>Changing to new tabs, windows, or any other action that causes a
-        page to lose focus will exit pointer lock.
+        page to lose focus will <a>exit pointer lock</a> with the User Agent's <a>pointer-lock target</a>.

```suggestion
        page to lose focus will <a>exit pointer lock</a> with the user agent's <a>pointer-lock target</a>.
```

> @@ -739,7 +1014,7 @@ <h2>
         Recommendations:
       </p>
       <ul>
-        <li>Esc key should exit pointer lock.
+        <li>Esc key should <a>exit pointer lock</a> with the User Agent's <a>pointer-lock target</a>.

```suggestion
        <li>Esc key should <a>exit pointer lock</a> with the user agent's <a>pointer-lock target</a>.
```

> @@ -808,7 +1083,7 @@ <h2>
         </h2>
         <p>
           When the pointer is locked 'wheel' events should be sent to the
-          pointer lock <a>target</a> element just as 'mousemove' events are.
+          pointer lock <a>pointer-lock target</a> element just as 'mousemove' events are.

```suggestion
          <a>pointer-lock target</a> element just as 'mousemove' events are.
```

> -        appropriate name with its <code>bubbles</code> attribute [[DOM]] set to
-        false to the pointer lock <a>target</a> element's [=Node/node
-        document=].
-      </p>
-      <p class="note">
-        Magnification software increases the size of content on the screen. It
-        uses the mouse to move the magnified point of focus around. When a
-        pointer lock is initiated, the magnification software needs to switch
-        to using the keyboard to move the magnified point of focus around
-        instead. When a pointerlockchange event is fired, web browsers
-        therefore need to make sure the event is communicated to assistive
-        technologies like screen magnifiers.
-      </p>
+      <section>
+        <h3>
+          The <dfn>pointer lock state</dfn> Definition

```suggestion
          The <dfn>pointer lock state</dfn> definition
```

> +          The process of exiting pointer lock is as follows:
+          <ol>
+            <li>
+              <a href=https://dom.spec.whatwg.org/#concept-event-fire">Fire an event</a> named
+                      <a>pointerlockchange</a> at <a>this</a>'s 
+                      <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> on the
+                      <a href="https://html.spec.whatwg.org/multipage/webappapis.html#user-interaction-task-source">
+                        User Interaction task source</a>
+            </li>
+            <li>
+              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).
+            </li>
+            <li>

This looks great!

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

Received on Friday, 2 October 2020 18:53:31 UTC