<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20832</bug_id>
          
          <creation_ts>2013-01-31 01:02:41 +0000</creation_ts>
          <short_desc>Consider defining methods for converting points between different transformed coordinate systems</short_desc>
          <delta_ts>2013-08-08 13:28:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSS</product>
          <component>CSSOM View</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jacob Rossi [MSFT]">jrossi</reporter>
          <assigned_to name="Simon Pieters">zcorpan</assigned_to>
          <cc>glenn</cc>
    
    <cc>smfr</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-css-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82387</commentid>
    <comment_count>0</comment_count>
    <who name="Jacob Rossi [MSFT]">jrossi</who>
    <bug_when>2013-01-31 01:02:41 +0000</bug_when>
    <thetext>Opening this based on discussion in the Pointer Events WG [1]

From Doug Schepers &lt;schepers@w3.org&gt;:

When elements are transformed (shifted X/y through translate, larger or smaller through scale, etc.) using CSS transforms or SVG, dealing with pointer events becomes more complicated and unintuitive... things just aren&apos;t where they appear to be.

This leads to all sorts of confusion for authors in positioning things... dragging, repositioning, or creating elements based on pointer position. (To a lesser extent, this is a general problem with positioning relative to transformed elements, but nesting context takes care of most non-pointer-position cases.)

Jonathan Watt (Mozilla) has a handy script library [2] that helps authors solve this in SVG, but unless someone knows about that script, it is frustrating. I think this should be solved in a spec, perhaps as a method to get the relative transformed coordinates in the appropriate coordinate space.

Also, webkit has non-standard APIs similar to this that might be a good starting point. [3]

WebKit has, on DOMWindow,

    WebKitPoint webkitConvertPointFromPageToNode(in Node node, in WebKitPoint p);
    WebKitPoint webkitConvertPointFromNodeToPage(in Node node,  in WebKitPoint p);

and

interface WebKitPoint {
    attribute float x;
    attribute float y;
};


[1] http://lists.w3.org/Archives/Public/public-pointer-events/2013JanMar/0046.html
[2] http://jwatt.org/svg/tmp/mouse-relative-positioning.svg
[3] http://lists.w3.org/Archives/Public/public-pointer-events/2013JanMar/0049.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87650</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2013-05-14 14:44:14 +0000</bug_when>
    <thetext>Also see
http://www.w3.org/mid/D0BC8E77E79D9846B61A2432D1BA4EAE02814C74@TK5EX14MBXC116.redmond.corp.microsoft.com
http://www.w3.org/mid/BANLkTi=ZtdL8ZaRYikupnJ6x+mh03bBtPg@mail.gmail.com</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>