OLD | NEW |
(Empty) | |
| 1 <svg onload="runTest()" width="500" height="150" viewBox="0 0 500 150" xmlns="ht
tp://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 2 <script src="../../resources/ahem.js"></script> |
| 3 <rect id="background" width="100%" height="100%" fill="blue" /> |
| 4 <text id="text"> |
| 5 <textPath id="textPath" xlink:href="#path">This is text on a path</textP
ath> |
| 6 </text> |
| 7 <defs> |
| 8 <path id="path" |
| 9 d="M 100 200 |
| 10 C 200 100 300 0 400 100 |
| 11 C 500 200 600 300 700 200 |
| 12 C 800 100 900 100 900 100" /> |
| 13 <style type="text/css"> |
| 14 <![CDATA[ |
| 15 text { |
| 16 font-family: Ahem; |
| 17 font-size: 40px; |
| 18 } |
| 19 ]]> |
| 20 </style> |
| 21 <script type="text/javascript"> |
| 22 <![CDATA[ |
| 23 function runTest() { |
| 24 if (window.testRunner) |
| 25 testRunner.dumpAsText(); |
| 26 |
| 27 // (160,120) is within #path's glyph cell bounds, (100,100) is n
ot. |
| 28 var text = document.getElementById("text"); |
| 29 var background = document.getElementById("background"); |
| 30 var textPath = document.getElementById("textPath"); |
| 31 if (document.elementFromPoint(160, 120) === textPath && document
.elementFromPoint(100, 100) === background) |
| 32 text.textContent = "PASS"; |
| 33 else |
| 34 text.textContent = "FAIL"; |
| 35 } |
| 36 ]]> |
| 37 </script> |
| 38 </defs> |
| 39 </svg> |
OLD | NEW |