Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for 3D ancestor transforms in getScreenCTM() #302

Open
BigBadaboom opened this issue Jan 4, 2017 · 3 comments
Open

Support for 3D ancestor transforms in getScreenCTM() #302

BigBadaboom opened this issue Jan 4, 2017 · 3 comments

Comments

@BigBadaboom
Copy link
Contributor

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 }
@boggydigital
Copy link
Contributor

Not blocking updated 2.0 CR publication - assigning 2.1 WD milestone

@dirkschulze
Copy link
Contributor

We do have another issue with vector-effects where this question came up. During the testing, it seemed like browsers do cross the pseudo-3D boundaries. Needs testing.

@dirkschulze
Copy link
Contributor

Related to #582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants