[Webkit-unassigned] [Bug 86010] . getTransformToElement doesn’t work correctly across embedded svg elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 10 00:01:10 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=86010


Nikolas Zimmermann <zimmermann at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |fmalita at chromium.org,
                   |                            |pdr at google.com,
                   |                            |schenney at chromium.org
     Ever Confirmed|0                           |1




--- Comment #1 from Nikolas Zimmermann <zimmermann at kde.org>  2012-05-10 00:00:14 PST ---
Thanks for the testcase Denis, and the detailed analysis - I can confirm your findings with FF/Opera and WebKit at least.

>From the spec: SVGMatrix getTransformToElement(in SVGElement element)
Returns the transformation matrix from the user coordinate system on the current element (after application of the ‘transform’ attribute, if any) to the user coordinate system on parameter element (after application of its ‘transform’ attribute, if any).

The user agent should build a transformation from the passed in 'element' down to the elements where the method is called. Clearly we and Opera have a bug here:

<svg width="600px" height="500px" version="1.1" xmlns="http://www.w3.org/2000/svg">
...
  <g transform="translate(30, 30)"> <!-- this transformation is ignored by webkit -->
    <svg width="150" height="150">
      <rect id="rect" x="50" y="50" width="25px" height="25px" fill="gray"></rect>
    </svg>
  </g>
</svg>

..
    var m = document.getElementById("rect").getTransformToElement(document.documentElement);
..

This should indeed build a transform that starts from the outermost <svg> down to the <rect> inside the inner <svg> element. We stop at the nearest viewport element instead, which is determined as the parent inner <svg> of the <rect>.

It's obvious that our behavior violates the spec. You should consider filing a bug against Opera as well.
CC'ing some Google/SVG folks who might be interested - this bug should be easy to fix.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list