<svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" 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>
<h:script src="../../resources/testharness.js"></h:script>
<h:script src="../../resources/testharnessreport.js"></h:script>
<h:script src="../../resources/testdriver.js"></h:script>
<h:script src="../../resources/testdriver-vendor.js"></h:script>
<h:script src="../../resources/testdriver-actions.js"></h:script>
<script>
promise_test(async () => {
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);
const actions = new test_driver.Actions()
.pointerMove(center.x, center.y)
.pointerDown()
.pointerUp()
.pointerDown()
.pointerUp();
await actions.send();
assert_equals(getSelection().toString().trim(), 'bar');
}, 'Double-click should select a word in the first line');
</script>
</svg>