OLD | NEW |
---|---|
(Empty) | |
1 <svg onload="runTest()" width="500" height="150" viewBox="0 0 1000 300" xmlns="h ttp://www.w3.org/2000/svg" onclick="click(evt)"> | |
fs
2015/11/17 09:47:49
Drop onclick.
pdr.
2015/11/17 21:51:23
Done
| |
2 <text id="text" x="10" y="1em">Foo <tspan id="tspan">Bar</tspan> Baz</text> | |
3 <defs> | |
4 <style type="text/css"> | |
5 <![CDATA[ | |
6 @font-face { | |
7 font-family: Ahem; | |
8 src: url(../../resources/Ahem.ttf); | |
9 } | |
10 text { | |
11 font-family: Ahem; | |
12 font-size: 40px; | |
13 } | |
14 ]]> | |
15 </style> | |
16 <script type="text/javascript"> | |
17 <![CDATA[ | |
18 function runTest() { | |
19 if (window.testRunner) | |
20 testRunner.dumpAsText(); | |
21 // The point at 15,15 is contained within the word "Foo", a text node. | |
22 // The point at 120,15 is contained within the word "Bar", a <ts pan>. | |
23 var text = document.getElementById("text"); | |
24 if (document.elementFromPoint(15, 15) === text && document.eleme ntFromPoint(110, 15) === document.getElementById("tspan")) | |
25 text.textContent = "PASS"; | |
26 else | |
27 text.textContent = "FAIL"; | |
28 } | |
29 ]]> | |
30 </script> | |
31 </defs> | |
32 </svg> | |
OLD | NEW |