1 <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">
2 <text id=
"line1" x=
"14" y=
"10" font-family=
"Arial" font-size=
"10" fill=
"black">foo bar baz
</text>
3 <text id=
"line2" x=
"14" y=
"20" font-family=
"Arial" font-size=
"10" fill=
"black">next line
</text>
5 var line1 = document.getElementById(
"line1");
6 var center = document.rootElement.createSVGPoint();
7 var matrix = document.rootElement.getTransformToElement(line1);
8 var bbox = line1.getBBox();
10 center.x = bbox.x + bbox.width/
2;
11 center.y = bbox.y + bbox.height/
2;
12 center = center.matrixTransform(matrix);
15 eventSender.mouseMoveTo(center.x, center.y);
16 eventSender.mouseDown();
17 eventSender.mouseUp();
18 eventSender.mouseDown();
19 eventSender.mouseUp();
20 eventSender.mouseDown();
21 eventSender.mouseUp();
24 if (window.testRunner)
25 window.testRunner.dumpSelectionRect();