viewBox-change-repaint-001.html (856B)
1 <!doctype HTML> 2 <head> 3 <meta charset="utf-8"> 4 <title>Testcase for dynamic viewBox change</title> 5 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 6 <link rel="help" href="https://www.w3.org/TR/SVG/coords.html#ViewBoxAttribute"> 7 <link rel="match" href="support/viewBox-change-repaint-001-ref.html"> 8 <script> 9 function go() { 10 var mySVG = document.getElementById("mySVG"); 11 mySVG.setAttribute("viewBox", "0 0 10 10"); 12 } 13 </script> 14 </head> 15 <body onload="go()"> 16 <!-- After we dynamically add viewBox="0 0 10 10", the lime area should 17 stretch to fill the 200x200 SVG viewport, and no red should be visible. 18 --> 19 <svg id="mySVG" style="height: 200px; width: 200px;"> 20 <rect width="200" height="200" fill="red"></rect> 21 <rect width="10" height="10" fill="lime"></rect> 22 </svg> 23 </body>