Changeset 86776 in webkit


Ignore:
Timestamp:
May 18, 2011 10:47:25 AM (13 years ago)
Author:
arv@chromium.org
Message:

2011-05-18 Erik Arvidsson <arv@chromium.org>

Reviewed by Ojan Vafai.

event.clientX/clientY is 0/0 in a click generated through a label
https://bugs.webkit.org/show_bug.cgi?id=56606

This tests that clicking on a label for an input generates a click event on the input
with the same coordinates as the original click.

  • fast/events/simulated-click-coords-expected.txt: Added.
  • fast/events/simulated-click-coords.html: Added.

2011-05-18 Erik Arvidsson <arv@chromium.org>

Reviewed by Ojan Vafai.

event.clientX/clientY is 0/0 in a click generated through a label
https://bugs.webkit.org/show_bug.cgi?id=56606

This copies the coordinates from the underlying event to the simulated mouse event if the underlying event
is a mouse event.

This makes us match Firefox and IE.

Test: fast/events/simulated-click-coords.html

  • dom/MouseEvent.cpp: (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86771 r86776  
     12011-05-18  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        event.clientX/clientY is 0/0 in a click generated through a label
     6        https://bugs.webkit.org/show_bug.cgi?id=56606
     7
     8        This tests that clicking on a label for an input generates a click event on the input
     9        with the same coordinates as the original click.
     10
     11        * fast/events/simulated-click-coords-expected.txt: Added.
     12        * fast/events/simulated-click-coords.html: Added.
     13
    1142011-05-18  Rob Buis  <rbuis@rim.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r86775 r86776  
     12011-05-18  Erik Arvidsson  <arv@chromium.org>
     2
     3        Reviewed by Ojan Vafai.
     4
     5        event.clientX/clientY is 0/0 in a click generated through a label
     6        https://bugs.webkit.org/show_bug.cgi?id=56606
     7
     8        This copies the coordinates from the underlying event to the simulated mouse event if the underlying event
     9        is a mouse event.
     10
     11        This makes us match Firefox and IE.
     12
     13        Test: fast/events/simulated-click-coords.html
     14
     15        * dom/MouseEvent.cpp:
     16        (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
     17
    1182011-05-18  Nikolas Zimmermann  <nzimmermann@rim.com>
    219
  • trunk/Source/WebCore/dom/MouseEvent.cpp

    r83386 r86776  
    151151    }
    152152    setUnderlyingEvent(underlyingEvent);
     153
     154    if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) {
     155        MouseEvent* mouseEvent = static_cast<MouseEvent*>(this->underlyingEvent());
     156        m_screenX = mouseEvent->screenX();
     157        m_screenY = mouseEvent->screenY();
     158        initCoordinates(mouseEvent->clientX(), mouseEvent->clientY());
     159    }
    153160}
    154161
Note: See TracChangeset for help on using the changeset viewer.