| <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 160 120"> |
| <text id="line1" x="14" y="10" font-family="Arial" font-size="10" fill="black">foo bar baz</text> |
| <text id="line2" x="14" y="20" font-family="Arial" font-size="10" fill="black">next line</text> |
| <script> |
| var line1 = document.getElementById("line1"); |
| var center = document.rootElement.createSVGPoint(); |
| var matrix = line1.getScreenCTM(); |
| var bbox = line1.getBBox(); |
| |
| center.x = bbox.x + bbox.width/2; |
| center.y = bbox.y + bbox.height/2; |
| center = center.matrixTransform(matrix); |
| |
| if (eventSender) { |
| eventSender.mouseMoveTo(center.x, center.y); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| } |
| |
| if (window.testRunner) |
| window.testRunner.dumpSelectionRect(); |
| </script> |
| </svg> |