| 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 <rect id="background" width="100%" height="100%" fill="blue" /> |
| 3 <text id="text" x="10" y="1em" dx="0 50 100">Foo</text> |
| 4 <defs> |
| 5 <style type="text/css"> |
| 6 <![CDATA[ |
| 7 @font-face { |
| 8 font-family: Ahem; |
| 9 src: url(../../resources/Ahem.ttf); |
| 10 } |
| 11 text { |
| 12 font-family: Ahem; |
| 13 font-size: 40px; |
| 14 } |
| 15 ]]> |
| 16 </style> |
| 17 <script type="text/javascript"> |
| 18 <![CDATA[ |
| 19 function runTest() { |
| 20 if (window.testRunner) |
| 21 testRunner.dumpAsText(); |
| 22 |
| 23 // The point at 15,15 is contained within the text's bounding bo
x. |
| 24 // The point at 30,15 is contained in between the text's charact
er cells |
| 25 // and thus should return the background. |
| 26 var text = document.getElementById("text"); |
| 27 var background = document.getElementById("background"); |
| 28 if (document.elementFromPoint(15, 15) === text && document.eleme
ntFromPoint(35, 15) === background) |
| 29 text.textContent = "PASS"; |
| 30 else |
| 31 text.textContent = "FAIL"; |
| 32 } |
| 33 ]]> |
| 34 </script> |
| 35 </defs> |
| 36 </svg> |
| OLD | NEW |