- From: <bugzilla@jessica.w3.org>
- Date: Mon, 09 Apr 2012 21:18:40 +0000
- To: public-css-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16673
Summary: Specify how MouseEventExtension coordinates are set
using initMouseEvent()
Product: CSS
Version: unspecified
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: normal
Priority: P2
Component: CSSOM View
AssignedTo: dave.null@w3.org
ReportedBy: jrossi@microsoft.com
QAContact: public-css-bugzilla@w3.org
The initMouseEvent() method from DOM L3 Events allows for the creation of
synthetic mouse events [1]. However, it seems it was defined prior to the
existence/standardization of the extensions to MouseEvent [2]. For
compatibility reasons, we don't believe we can change the signature of
initMouseEvent() to include properties like pageX/pageY. Instead, we suggest
calculating these values based on the inputs provided for clientX/clientY. This
seems to be what Webkit (and to some extent, Firefox) do.
pageX = clientX + scrollLeft (using the values at the time of calling
initMouseEvent)
pageY = clientY + scrollTop
x = clientX
y = clientY
Prior to calling dispatchEvent() (which indicates a target element for the
event)"
offsetX = pageX
offsetY = pageY
After calling dispatchEvent() (e.g. during and after the dispatch of the
event):
offsetX = the x offset relative to the padding edge of the target element (as
reported in the element's coordinate space)
offsetY = the y offset relative to the padding edge of the target element (as
reported in the element's coordinate space)
[1]http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-event-type-initMouseEvent
[2]http://dev.w3.org/csswg/cssom-view/#extensions-to-the-mouseevent-interface
--
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 9 April 2012 21:18:43 UTC