<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Improvements to webkitmouseforce web API"
   href="https://bugs.webkit.org/show_bug.cgi?id=143387#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Improvements to webkitmouseforce web API"
   href="https://bugs.webkit.org/show_bug.cgi?id=143387">bug 143387</a>
              from <span class="vcard"><a class="email" href="mailto:bdakin&#64;apple.com" title="Beth Dakin &lt;bdakin&#64;apple.com&gt;"> <span class="fn">Beth Dakin</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=143387#c7">comment #7</a>)
<span class="quote">&gt; Comment on <span class=""><a href="attachment.cgi?id=250103&amp;action=diff" name="attach_250103" title="Patch">attachment 250103</a> <a href="attachment.cgi?id=250103&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=250103&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=250103&amp;action=review</a>
&gt; 
&gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:345
&gt; &gt; +    , m_lastForceStage(0)
&gt; 
&gt; No need to initialize here if you take my suggestion below.
&gt; 
&gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.h:1348
&gt; &gt; +    int m_lastForceStage;
&gt; 
&gt; Better to initialize this here:
&gt; 
&gt;     int m_lastForceStage { 0 };
&gt; 
&gt; or even:
&gt; 
&gt;     int m_lastForceStage { };
&gt; </span >

Will do!

<span class="quote">&gt; &gt; Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:1168
&gt; &gt; +    float overallForce = stage &lt; 1 ? force : force + stage - 1;
&gt; 
&gt; I guess the force number is in the range [0,1]? Should we assert that?</span >

Right now the force ranges from 0-2. Stage 0 represents the stage between touching the trackpad and mousedown, but AppKit does not send us any force information in that time except for 0 and 1 to represent exiting or entering that stage. 

Then stage 1 is between mousedown and mouseforcedown. We get force in a range from 0-1 there.

And stage 2 is mouseforcedown and beyond. We get force in a range from 0-1 there as well.

So right now we expose force from 0-2 where 0 represents anything before mousedown or after mouseup, and 1 corresponds to forcemousedown/up. 2 is the theoretical hardest you can press.

I don't think we want to assert anything at this time, because all of this could change. We're figuring out the best way to massage the platform events into something that makes sense for a web API, and it's an ongoing discussion.

Thanks Darin!</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>