Wibbly-wobbly behavior in Chrome (Blink)
A continuously resizing SVG `<image>` element and a yellow rectangle reveal a rendering discrepancy in Chrome’s Blink engine: despite `preserveAspectRatio="xMinYMin"` on both the image and its referenced SVG, the graphic stretches while the rectangle stays fixed. Using d3.v4, the code animates both elements’ widths from 128 to 192 pixels over ten seconds via `transition.attr`. The effect intensifies with browser zoom, highlighting a bug where Blink ignores the image’s aspect-ratio constraint when loading external SVG files.
AI-generated descriptionIncrease the zoom factor for a stronger effect on Google Chrome.
The widths of the <image> element inside the SVG is being changed continously but since preserveAspectRatio is set to xMinYMin (i.e. aspect ratio will be preserved and image will stick to topleft corner) it should have no effect. It does have an effect though in Mozilla Firefox (Gecko) as of version 54 and Google Chrome 61 (Blink). In latter the effect is even more pronounced when zoomed in.
(On a side note, the preserveAspectRatio attribute is set inside the SVG and on the image element, in Chrome latter does not override former if SVG images are referenced because of http://crbug.com/499373. Since in this example both attributes are set to the same value it makes no difference.)