RESOLVED FIXED 163648
MouseEvent's coordinates should be 0 for simulated clicks
https://bugs.webkit.org/show_bug.cgi?id=163648
Summary MouseEvent's coordinates should be 0 for simulated clicks
Chris Dumez
Reported 2016-10-18 20:45:31 PDT
MouseEvent.screenX / screenY should be 0 / 0 for simulated clicks. This is the behavior of Chrome and Firefox. However, WebKit computes actual screenX / screenY values which requires a synchronous IPC with the UI process. Demo: https://jsfiddle.net/7nc7ufkh/1/
Attachments
Patch (4.99 KB, patch)
2016-10-18 22:52 PDT, Chris Dumez
no flags
Patch (10.05 KB, patch)
2016-10-18 23:22 PDT, Chris Dumez
no flags
Patch (9.87 KB, patch)
2016-10-18 23:59 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-10-18 20:48:52 PDT
https://jsfiddle.net/7nc7ufkh/3/ shows that clientX / clientY are also 0 for simulated clicks in Firefox and Chrome.
Chris Dumez
Comment 2 2016-10-18 20:53:44 PDT
All coordinates (screenX, clientX, x, layerX, offsetX, pageX) are 0 in Firefox and Chrome for simulated clicks. However, they are all populated in Safari.
Chris Dumez
Comment 3 2016-10-18 22:17:31 PDT
Seems to have been caused by <https://trac.webkit.org/changeset/160032>.
Chris Dumez
Comment 4 2016-10-18 22:52:24 PDT
Darin Adler
Comment 5 2016-10-18 22:55:17 PDT
Comment on attachment 292048 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=292048&action=review > Source/WebCore/dom/SimulatedClick.cpp:70 > + } else if (AXObjectCache::accessibilityEnabled()) { > + // We apparently need coordinates when accessibility is enabled (see Bug 76677). > + // In other cases, the coordinates will be 0, which matches the behavior of Firefox and Chrome. > + // Note that the call to screenRect() causes a synchronous IPC with the UI process. This really doesn’t make sense. It’s OK to decide that accessibility-driven clicks need to include coordinates to be more like clicks done in other ways, but clicks created by JavaScript on the webpage don’t need them. We should not be checking globally whether accessibility is enabled. Instead we should have that code path pass a different argument or call a different function.
Chris Dumez
Comment 6 2016-10-18 23:22:38 PDT
Chris Dumez
Comment 7 2016-10-18 23:59:20 PDT
Darin Adler
Comment 8 2016-10-19 10:27:00 PDT
*** Bug 130301 has been marked as a duplicate of this bug. ***
WebKit Commit Bot
Comment 9 2016-10-19 10:49:26 PDT
Comment on attachment 292052 [details] Patch Clearing flags on attachment: 292052 Committed r207544: <http://trac.webkit.org/changeset/207544>
WebKit Commit Bot
Comment 10 2016-10-19 10:49:32 PDT
All reviewed patches have been landed. Closing bug.
Chris Dumez
Comment 11 2016-10-19 19:28:34 PDT
Looks like a 4% progression on Speedometer.
Lucas Forschler
Comment 12 2019-02-06 09:18:42 PST
Mass move bugs into the DOM component.
Note You need to log in before you can comment on or make changes to this bug.