Bug 165270

Summary: [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, simon.fraser, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: http://magento.stackexchange.com/questions/147870/issue-bug-with-ios-devices-and-magento-mobile-theme-html5
Attachments:
Description Flags
Patch none

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.