Updating href on textPath doesn't update its rendering
[WebKit-https.git] / LayoutTests / svg / text / textpath-reference-update.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p>Test passes if you see a single 100px by 100px green box below.</p>
5 <svg style="width: 100px; height: 100px;" viewbox="0 0 100 100">
6     <defs>
7         <path id="path1" d="M0,50 L100,50 Z" />
8         <path id="path2" d="M0,-5 L100,-5 Z" />
9     </defs>
10     <rect x="0" y="0" width="100" height="100" fill="green"></rect>
11     <text>
12         <textPath href="#path1">FAIL</textPath>
13     </text>
14 </svg>
15 <script>
16
17 if (window.testRunner)
18     testRunner.waitUntilDone();
19
20 window.onload = () => {
21     requestAnimationFrame(() => {
22         document.querySelector('textPath').setAttribute('href', '#path2');
23         if (window.testRunner)
24             requestAnimationFrame(() => testRunner.notifyDone());
25     });
26 }
27
28 </script>
29 </body>
30 </html>