- From: Jeff Schiller <codedread@gmail.com>
- Date: Tue, 19 Jan 2010 21:25:32 -0600
- To: www-svg <www-svg@w3.org>
Is the following test case correct: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <rect id="r" x="100" y="100" width="200" height="100" fill="red" /> <use id="u" x="200" y="200" width="400" height="200" xlink:href="#r"/> <script><![CDATA[ var u = document.getElementById("u"), r = document.getElementById("r"), b = u.getBBox(); if (console && console.log) console.log([b.x,b.y,b.width,b.height]); if (b.x == 200 && b.y == 200 && b.width == 400 && b.height == 200) ) { r.setAttribute("fill", "green"); } ]]></script> </svg> In other words, shouldn't the bbox of a <use> element be defined by its x,y,width,height just like a <rect> or an <image> ? No browser gives consistent results: Firefox : 100, 100, 200, 100 Opera : 100, 100, 200, 100 WebKit : 300, 300, 200, 100 (huh? clearly a bug!) What's ASV do? What's IE9 do? :) Thanks, Jeff
Received on Wednesday, 20 January 2010 03:26:05 UTC