Bug 56606 - event.clientX/clientY is 0/0 in a click generated through a label
Summary: event.clientX/clientY is 0/0 in a click generated through a label
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-17 16:00 PDT by xiyuan
Modified: 2011-05-18 10:47 PDT (History)
6 users (show)

See Also:


Attachments
Patch (5.13 KB, patch)
2011-05-18 10:13 PDT, Erik Arvidsson
no flags Details | Formatted Diff | Diff
Patch: Fix test to not print coord when passing (5.51 KB, patch)
2011-05-18 10:26 PDT, Erik Arvidsson
ojan: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Erik Arvidsson 2011-05-17 16:07:34 PDT
Given a label for an input. When the user clicks the label we generate a simulated click event on the input. However, this event has all its coordinates set to 0.

I have a fix for this where we use the coordinates of the underlying event for simulated clicks.
Comment 2 Erik Arvidsson 2011-05-18 10:13:25 PDT
Created attachment 93929 [details]
Patch
Comment 3 Erik Arvidsson 2011-05-18 10:15:00 PDT
Emil, I know you are not yet a reviewer but since you looked at mouse coordinates recently I would appreciate if you could take a quick look at this.
Comment 4 Erik Arvidsson 2011-05-18 10:26:56 PDT
Created attachment 93931 [details]
Patch: Fix test to not print coord when passing
Comment 5 Ojan Vafai 2011-05-18 10:33:49 PDT
Comment on attachment 93931 [details]
Patch: Fix test to not print coord when passing

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

> LayoutTests/fast/events/simulated-click-coords.html:6
> +<p>Ensure that simulated click uses the original mouse coordinates.</p>

Ensure that simulated click on label elements uses the original mouse coordinates.
Comment 6 Emil A Eklund 2011-05-18 10:39:51 PDT
LGTM. I'd like to see a test where the label is inside a scrolled container though, just to make sure all the coordinates are calculated correctly.
Comment 7 Erik Arvidsson 2011-05-18 10:47:38 PDT
Committed r86776: <http://trac.webkit.org/changeset/86776>