Bug 165270 - [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
Summary: [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: http://magento.stackexchange.com/ques...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-12-01 13:37 PST by Chris Dumez
Modified: 2019-02-06 09:18 PST (History)
4 users (show)

See Also:


Attachments
Patch (7.26 KB, patch)
2016-12-01 13:48 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-12-01 13:37:30 PST
Tapping an element generates a 'click' event that has 0 as timeStamp.
Comment 1 Chris Dumez 2016-12-01 13:37:52 PST
<rdar://problem/29224355>
Comment 2 Chris Dumez 2016-12-01 13:48:57 PST
Created attachment 295887 [details]
Patch
Comment 3 Simon Fraser (smfr) 2016-12-01 13:51:58 PST
Comment on attachment 295887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=295887&action=review

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:573
> +    tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType));
> +    tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType));

Should these be currentMonotonicTime instead? What do we use for other events?
Comment 4 Chris Dumez 2016-12-01 13:53:13 PST
(In reply to comment #3)
> Comment on attachment 295887 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=295887&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:573
> > +    tapWasHandled |= mainframe.eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType));
> > +    tapWasHandled |= mainframe.eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, syntheticClickType));
> 
> Should these be currentMonotonicTime instead? What do we use for other
> events?

currentTime:
Source/WebCore/dom/Element.cpp:    PlatformMouseEvent platformMouseEvent { frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap };
Source/WebCore/page/ContextMenuController.cpp:    PlatformMouseEvent mouseEvent(clickPoint, clickPoint, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), ForceAtClick, NoTap);
Source/WebCore/page/EventHandler.cpp:    PlatformMouseEvent platformMouseEvent(position, globalPosition, RightButton, eventType, 1, false, false, false, false, WTF::currentTime(), ForceAtClick, NoTap);
Source/WebCore/page/EventHandler.cpp:    PlatformMouseEvent fakeMouseMoveEvent(m_lastKnownMousePosition, m_lastKnownMouseGlobalPosition, NoButton, PlatformEvent::MouseMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime(), 0, NoTap);
Source/WebKit2/WebProcess/WebPage/WebPage.cpp:    PlatformMouseEvent mouseEvent(point, point, RightButton, PlatformEvent::MousePressed, 1, false, false, false, false, currentTime(), WebCore::ForceAtClick, WebCore::NoTap);
Source/WebKit2/WebProcess/WebPage/WebPage.cpp:    PlatformMouseEvent event(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, currentTime(), 0, WebCore::NoTap);
Comment 5 Chris Dumez 2016-12-01 14:49:17 PST
Comment on attachment 295887 [details]
Patch

Clearing flags on attachment: 295887

Committed r209215: <http://trac.webkit.org/changeset/209215>
Comment 6 Chris Dumez 2016-12-01 14:49:22 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Lucas Forschler 2019-02-06 09:18:37 PST
Mass move bugs into the DOM component.