Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | <!-- |
michael@0 | 2 | Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | --> |
michael@0 | 5 | <svg xmlns="http://www.w3.org/2000/svg" class="reftest-wait" style="font: 16px sans-serif"> |
michael@0 | 6 | <text x="100 150 200 250" y="50"><tspan>12</tspan>34</text> |
michael@0 | 7 | <text x="100 150 200 250" y="100"><tspan display="none">12</tspan>34</text> |
michael@0 | 8 | <text x="100 150 200 250" y="150">34</text> |
michael@0 | 9 | <text x="100 150 200 250" y="200">34</text> |
michael@0 | 10 | <text x="100 150 200 250 300 350" y="250"><tspan>12</tspan>56</text> |
michael@0 | 11 | <text x="100 150 200 250 300 350" y="300"><tspan>12</tspan>56</text> |
michael@0 | 12 | <text x="100 150 200 250" y="350"><tspan display="none"/>34</text> |
michael@0 | 13 | |
michael@0 | 14 | <script> |
michael@0 | 15 | function newTSpan(s) { |
michael@0 | 16 | var e = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); |
michael@0 | 17 | e.textContent = s; |
michael@0 | 18 | return e; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | function f() { |
michael@0 | 22 | window.removeEventListener("MozAfterPaint", f); |
michael@0 | 23 | |
michael@0 | 24 | var t = document.getElementsByTagName("text"); |
michael@0 | 25 | var e; |
michael@0 | 26 | |
michael@0 | 27 | t[0].removeChild(t[0].firstChild); |
michael@0 | 28 | |
michael@0 | 29 | t[1].removeChild(t[1].firstChild); |
michael@0 | 30 | |
michael@0 | 31 | e = newTSpan("12"); |
michael@0 | 32 | t[2].insertBefore(e, t[2].firstChild); |
michael@0 | 33 | |
michael@0 | 34 | e = newTSpan("12"); |
michael@0 | 35 | e.setAttribute("display", "none"); |
michael@0 | 36 | t[3].insertBefore(e, t[3].firstChild); |
michael@0 | 37 | |
michael@0 | 38 | e = newTSpan("34"); |
michael@0 | 39 | t[4].firstChild.appendChild(e); |
michael@0 | 40 | |
michael@0 | 41 | e = newTSpan("34"); |
michael@0 | 42 | e.setAttribute("display", "none"); |
michael@0 | 43 | t[5].firstChild.appendChild(e); |
michael@0 | 44 | |
michael@0 | 45 | e = newTSpan("12"); |
michael@0 | 46 | t[6].firstChild.appendChild(e); |
michael@0 | 47 | |
michael@0 | 48 | setTimeout(function() { |
michael@0 | 49 | document.documentElement.removeAttribute("class"); |
michael@0 | 50 | }, 0); |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | window.addEventListener("MozAfterPaint", f, false); |
michael@0 | 54 | </script> |
michael@0 | 55 | </svg> |