[webkit-reviews] review granted: [Bug 73647] [Qt] [WK2] Use input event timestamps in WebEvents if available : [Attachment 117611] proposed patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Dec 2 05:32:50 PST 2011
Simon Hausmann <hausmann at webkit.org> has granted Andras Becsi
<abecsi at webkit.org>'s request for review:
Bug 73647: [Qt] [WK2] Use input event timestamps in WebEvents if available
https://bugs.webkit.org/show_bug.cgi?id=73647
Attachment 117611: proposed patch
https://bugs.webkit.org/attachment.cgi?id=117611&action=review
------- Additional Comments from Simon Hausmann <hausmann at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=117611&action=review
> Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp:51
> + if (event->timestamp())
> + return static_cast<double>(event->timestamp()) / 1000;
> +
> + return WTF::currentTime();
Hrmm, a run-time check. Isn't this going to be cause all sorts of havoc if
_some_ events had time stamps and some didn't?
Imagine: first mouse events has a time stamp, second one doesn't and we use
WTF::currentTime(). What if by chance WTF::currentTime() is less than the
previous time stamp?
Perhaps we should try to protect ourselves against this situation. Perhaps by
keeping track which events (of which type that is) have a "native" time stamp
and which ones require "emulation", and
we let the first event decide. This could even be done in debug builds only.
Perhaps this is overkill, just a thought. Otherwise I think the patch is good
:)
More information about the webkit-reviews
mailing list