[svgwg] getScreenCTM (and friends?) results for elements that are not in the rendering tree?

fsoder has just created a new issue for https://github.com/w3c/svgwg:

== getScreenCTM (and friends?) results for elements that are not in 
the rendering tree? ==
>From the way the algorithm for getScreenCTM [1] is currently writted, 
it could be interpreted such that whether the element is in the 
rendering tree or not is not relevant, and the CTM would be computed 
based ("solely") on the DOM structure.
The main reason for asking is really because of strong connection to 
interfaces such as getClientRects [2] (a bond the spec even makes in a
 note), which will return an empty result in such cases.
If the current text is intentional, maybe a slight addition can be 
made to spell this out? (Much like how the section on bounding boxes 
[3] calls this out I suppose.)

I did a quick test (Gecko and Blink/Chromium 57), non-rendering tree 
elements seem to compute an "accurate" CTM as long as they don't also 
would've taken part in CSS layout. (So a `<rect>` with `display:none` 
gets a proper CTM, while an outermost `<svg>` does not. The latter 
also gives different result between the two UAs tested.)

[1] 
https://svgwg.org/svg2-draft/types.html#__svg__SVGGraphicsElement__getScreenCTM
[2] https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
[3] https://svgwg.org/svg2-draft/coords.html#BoundingBoxes

Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/307 using your GitHub account

Received on Wednesday, 22 February 2017 10:26:12 UTC