title: Firefox browser offsetX/Y
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const $test = document.querySelector('.test');
  
  function sleep() {
    return new Promise(resolve =&gt; {
      setTimeout(() =&gt; {
        resolve();
      }, 300);
    });
  }
  $test.addEventListener('mousedown', async e =&gt; {
    console.log(e.offsetX, e.offsetY); // (90, 163) any other values but not 0
    await sleep();
    console.log(e.offsetX, e.offsetY); // 0 0
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#app {
    position: relative;
    width: 100vw;
    height: 100vh;
  }
  
  .test {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background-color: aqua;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="app"&gt;
    &lt;div class="test"&gt;&lt;/div&gt;
    &lt;!-- &lt;canvas width="300" height="300" class="test"&gt;&lt;/canvas&gt; --&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>#Note
  It's alright in Google browser, but there has an error in Firefox browser.</p>
  <ol>
  <li>The offsetX/Y has value before sleeping.</li>
  <li>The offsetX/Y's value become 0.</li>
  </ol>
  <p>Can anyone tell me why?</p>