OLD | NEW |
(Empty) | |
| 1 <svg onload="runTest()" width="500" height="150" viewBox="0 0 1000 300" xmlns="h
ttp://www.w3.org/2000/svg"> |
| 2 <script src="../../resources/ahem.js"></script> |
| 3 <rect id="background" width="100%" height="100%" fill="blue" /> |
| 4 <text id="text" x="10" y="1em" dx="0 50 100">Foo</text> |
| 5 <defs> |
| 6 <style type="text/css"> |
| 7 <![CDATA[ |
| 8 text { |
| 9 font-family: Ahem; |
| 10 font-size: 40px; |
| 11 } |
| 12 ]]> |
| 13 </style> |
| 14 <script type="text/javascript"> |
| 15 <![CDATA[ |
| 16 function runTest() { |
| 17 if (window.testRunner) |
| 18 testRunner.dumpAsText(); |
| 19 |
| 20 // (15,15) is within a glyph cell of #text, (35,15) is not. |
| 21 var text = document.getElementById("text"); |
| 22 var background = document.getElementById("background"); |
| 23 if (document.elementFromPoint(15, 15) === text && document.eleme
ntFromPoint(35, 15) === background) |
| 24 text.textContent = "PASS"; |
| 25 else |
| 26 text.textContent = "FAIL"; |
| 27 } |
| 28 ]]> |
| 29 </script> |
| 30 </defs> |
| 31 </svg> |
OLD | NEW |