- From: Nikos Andronikos via GitHub <sysbot+gh@w3.org>
- Date: Tue, 10 Jan 2017 23:26:31 +0000
- To: public-svg-issues@w3.org
nikosandronikos has just labeled an issue for
https://github.com/w3c/svgwg as "SVG Core":
== Support for 3D ancestor transforms in `getScreenCTM()` ==
https://svgwg.org/svg2-draft/single-page.html#types-__svg__SVGGraphicsElement__getScreenCTM
Should the definition of `getScreenCTM()` make any comment on how 3D
transforms on ancestor (HTML) elements should be handled? From my
experimentation, it seems Chrome does attempt to support this (but is
currently bugged). Firefox does not seem to have updated
`getScreenCTM()` for SVG2 yet.
https://jsfiddle.net/r8887x05/1/
```
<div id="mydiv" style="transform: translate(1px,0) scale(2)">
<svg>
<circle id="mycircle" cx="50" cy="50" r="10"/>
</svg>
</div>
var div = document.getElementById('mydiv');
var circle = document.getElementById('mycircle');
console.log("before=", circle.getScreenCTM());
div.setAttribute("style", "transform: translate3D(1px,0,0) scale(2)");
console.log("after=", circle.getScreenCTM());
```
Chrome results *(bug? scale transform is reflected in e and f, but not
a and d)*:
```
before= SVGMatrix { a: 1, b: 0, c: 0, d: 1, e: -335.5, f: -69 }
after= SVGMatrix { a: 1, b: 0, c: 0, d: 1, e: -335.5, f:-69 }
```
Firefox results *(ancestor transforms have no effect)*:
```
before= SVGMatrix { a: 1, b: 0, c: 0, d: 1, e: 8, f: 8 }
after= SVGMatrix { a: 1, b: 0, c: 0, d: 1, e: 8, f: 8 }
```
See https://github.com/w3c/svgwg/issues/302
Received on Tuesday, 10 January 2017 23:26:37 UTC