| <!DOCTYPE html> |
| <title>Text Selection when dragging mouse outside the SVG text element</title> |
| <style> |
| text { |
| font: 10px Arial; |
| } |
| </style> |
| <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0 0 500 500" style="border: 1px solid black;"> |
| <g> |
| <text id="line1" x="10" y="30">Hello World. Hello, SVG.</text> |
| </g> |
| <g transform="translate(120, 30)"> |
| <text id="line2" x="50" y="50">Hello World. Hello, SVG.</text> |
| </g> |
| <g transform="translate(240, 30)"> |
| <text id="line3" x="100" y="100">Hello World. Hello, SVG.</text> |
| </g> |
| </svg> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="resources/SelectionTestCase.js"></script> |
| <script> |
| test(function() { |
| var absEndPos = getEndPosition('line3', 10, { x : 0, y : 30}); |
| selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementId: "line1", start: 7, endElementId: "line3", end: 11 }); |
| |
| absEndPos = getEndPosition('line2', 10, { x : 0, y : 30}); |
| selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementId: "line1", start: 7, endElementId: "line2", end: 11 }); |
| |
| absEndPos = getEndPosition('line3', 10, { x : 0, y : 30}); |
| selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementId: "line2", start: 7, endElementId: "line3", end: 11 }); |
| |
| absEndPos = getEndPosition('line1', 8, { x : 0, y : -30}); |
| selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementId: "line3", start: 7, endElementId: "line1", end: 9 }); |
| |
| absEndPos = getEndPosition('line1', 8, { x : 0, y : -30}); |
| selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementId: "line2", start: 7, endElementId: "line1", end: 9 }); |
| |
| absEndPos = getEndPosition('line2', 8, { x : 0, y : -30}); |
| selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementId: "line3", start: 7, endElementId: "line2", end: 9 }); |
| }); |
| </script> |