<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Summing up all movementX of mousemove events does not give the total difference in position"
   href="https://bugs.webkit.org/show_bug.cgi?id=235116">235116</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Summing up all movementX of mousemove events does not give the total difference in position
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>Safari 15
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>UI Events
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned@lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>guillaume.brunerie@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The specification of the MouseEvent.movementX/Y properties says that

<span class="quote">> All motion data must be delivered via mousemove events such that between any two mouse events earlierEvent and currentEvent the value of currentEvent.screenX-earlierEvent.screenX is equivalent to the sum of all movementX movementY/code> events after earlierEvent, with the exception of when screenX can not be updated because the pointer is clipped by the user agent screen boundaries.</span >
(see <a href="https://w3c.github.io/pointerlock/#dom-mouseevent-movementx">https://w3c.github.io/pointerlock/#dom-mouseevent-movementx</a>)

It works perfectly fine in Chrome but does not seem to work as expected in Safari, as soon as I move the mouse I get differences of several hundreds of pixels.
See the following CodePen: <a href="https://codepen.io/Latcarf/pen/YzrRvZE">https://codepen.io/Latcarf/pen/YzrRvZE</a>

Tested with Safari Version 15.1 (15612.2.9.1.30, 15612), on MacOS Catalina version 10.15.7 (19H1615).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>