[Webkit-unassigned] [Bug 94987] Add systemTime to DOM events

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 8 08:31:13 PST 2012


--- Comment #58 from Robert Flack <flackr at chromium.org>  2012-11-08 08:32:47 PST ---
(From update of attachment 170978)
View in context: https://bugs.webkit.org/attachment.cgi?id=170978&action=review

>> Source/WebCore/dom/Event.h:108
>> +    double systemTime() const { return m_timeStamp; }
> This is a bit confusing... so m_timeStamp is systemTime and m_createTime is timeStamp()? Could we use m_systemTime instead?


>> Source/WebCore/dom/Node.cpp:2661
>> +    return EventDispatcher::dispatchEvent(this, WheelEventDispatchMediator::create(event, document()->defaultView(), 1000.0 * document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(event.timestamp())));
> Perhaps you could make an auxiliary function to deal with this timestamp transformation? It's repeated three times already in the same file.

I'm a little unsure about this, it would just be wrapping DocumentLoadTiming::monotonicTimeToZeroBasedDocumentTime. I could create a function higher up the chain (Document?) to do this but then it could be confusing why we have two functions in different places that do the same thing. What do you think is best?

>> Source/WebCore/page/EventHandler.cpp:3065
>> +    RefPtr<KeyboardEvent> keypress = KeyboardEvent::create(keyPressEvent, m_frame->document()->defaultView(), 1000.0 * m_frame->document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(initialKeyEvent.timestamp()));
> I still don't like much "m_frame->document()->loader()->timing()->monotonicTimeToZeroBasedDocumentTime". Are we sure that no one in the middle can be null pointer? Perhaps you should add asserts on your auxiliary function (if you plan to do it).

We use this in Performance::now(), it should always exist but if this gets refactored into a common function I can add asserts.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list