OLD | NEW |
1 <?xml version="1.0" standalone="no"?> | 1 <?xml version="1.0" standalone="no"?> |
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1
.1/DTD/svg11.dtd"> | 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1
.1/DTD/svg11.dtd"> |
3 <svg viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmln
s:xlink="http://www.w3.org/1999/xlink"> | 3 <svg viewBox="0 0 400 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmln
s:xlink="http://www.w3.org/1999/xlink"> |
4 <defs> | 4 <defs> |
5 <symbol id="symbol" overflow="visible" viewBox="0 0 1000 1000"> | 5 <symbol id="symbol" overflow="visible" viewBox="0 0 1000 1000"> |
6 <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"
/> | 6 <rect stroke-width="5px" fill="red" stroke="navy" width="60" height="10"
/> |
7 </symbol> | 7 </symbol> |
8 </defs> | 8 </defs> |
9 | 9 |
10 <use x="25" y="25" xlink:href="#symbol"/> | 10 <use x="25" y="25" xlink:href="#symbol"/> |
11 <use x="125" y="25" xlink:href="#symbol"/> | 11 <use x="125" y="25" xlink:href="#symbol"/> |
12 | 12 |
13 <text font-size="10" id="text" x="30" y="70">You should shapes _above_ this text
</text> | 13 <text font-size="10" id="text" x="30" y="70">You should shapes _above_ this text
</text> |
14 | 14 |
15 <script> | 15 <script> |
16 var useElement = document.getElementsByTagName("use")[1]; | 16 var useElement = document.getElementsByTagName("use")[1]; |
17 var element = useElement.instanceRoot.correspondingElement; | 17 var element = document.getElementById("symbol"); |
18 element.removeAttribute("viewBox"); | 18 element.removeAttribute("viewBox"); |
19 </script> | 19 </script> |
20 </svg> | 20 </svg> |
OLD | NEW |