[Webkit-unassigned] [Bug 143387] Improvements to webkitmouseforce web API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 3 16:44:17 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=143387

--- Comment #8 from Beth Dakin <bdakin at apple.com> ---
(In reply to comment #7)
> Comment on attachment 250103 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250103&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:345
> > +    , m_lastForceStage(0)
> 
> No need to initialize here if you take my suggestion below.
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.h:1348
> > +    int m_lastForceStage;
> 
> Better to initialize this here:
> 
>     int m_lastForceStage { 0 };
> 
> or even:
> 
>     int m_lastForceStage { };
> 

Will do!

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

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!

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150403/fe2975e8/attachment-0001.html>


More information about the webkit-unassigned mailing list