(In reply to Cameron McCormack (:heycam) from comment #3) > According to the SVG specification, the transform that vector-effect:non-scaling-stroke should counteract is the one from the current coordinate space up to the furthest ancestor <svg> element. Strictly speaking, the spec uses the term "the furthest ancestral SVG **viewport**" (emphasis added). And in this case, I'd say that the relevant "SVG viewport" is the specified-sized rectangular background region that the image is rendered into. For comparison, note that we get "expected results" (skinny stroke regardless of px sizing) from a sized `<img>` element: ``` <img src="X.svg" style="height:400px; width:400px"> ``` But the stroke grows with the px sizing if you use `background-size` as in: ``` <div style="width:400px; height: 400px; background: url(X.svg); background-size: 400px 400px;"> ``` Intuitively it seems like these scenarios should be equivalent. > So that doesn't include any transforms caused by CSS image sizing. I agree that e.g. CSS transforms and other graphical effects outside of the SVG document shouldn't be taken into consideration (i.e. shouldn't be counteracted) -- but the known-in-advance CSS-pixel-valued size of the viewport should probably be taken into consideration.
Bug 1530525 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Cameron McCormack (:heycam) from comment #3) > According to the SVG specification, the transform that vector-effect:non-scaling-stroke should counteract is the one from the current coordinate space up to the furthest ancestor <svg> element. Strictly speaking, the spec uses the term "the furthest ancestral SVG **viewport**" (emphasis added). And in this case, I'd say that the relevant "SVG viewport" is the specified-sized rectangular background region that the image is rendered into. For comparison, note that we get "expected results" (skinny stroke regardless of px sizing) from a sized `<img>` element: ``` <img src="X.svg" style="height:400px; width:400px"> ``` But the stroke grows with the px sizing if you use `background-size` as in: ``` <div style="width:400px; height: 400px; background: url(X.svg); background-size: 400px 400px;"> ``` Intuitively it seems like these scenarios should be equivalent. > So that doesn't include any transforms caused by CSS image sizing. I agree that e.g. CSS transforms and other paint-time graphical effects outside of the SVG content shouldn't be taken into consideration (i.e. shouldn't be counteracted) -- but the known-in-advance CSS-pixel-valued size of the viewport should probably be taken into consideration.