Index: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.html |
diff --git a/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.html b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..909256cfc4ea1edba70968cf51dc6d5d6a0bc110 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.html |
@@ -0,0 +1,73 @@ |
+<!DOCTYPE html> |
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0 0 430 430" style="border: 1px solid black;"> |
+ <g> |
+ <text id="line1" x="10" y="70" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text> |
+ </g> |
+ <g transform="translate(100,100)"> |
+ <text id="line2" x="10" y="70" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text> |
+ </g> |
+ <g transform="translate(200,200)"> |
+ <text id="line3" x="10" y="70" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text> |
+ </g> |
+</svg> |
+<script src="../../resources/js-test.js"></script> |
+<script src="resources/SelectionTestCase.js"></script> |
+<script type="text/javascript"> |
+var range; |
+function runTest() { |
+ selectText('line1', 0, 10); |
+ verify("0", "11"); |
+ |
+ selectText('line1', 6, 10); |
+ verify("6", "11"); |
+ |
+ selectText('line1', 12, 23); |
+ verify("12", "24"); |
+ |
+ selectText('line2', 0, 10); |
+ verify("0", "11"); |
+ |
+ selectText('line2', 6, 10); |
+ verify("6", "11"); |
+ |
+ selectText('line2', 12, 23); |
+ verify("12", "24"); |
+ |
+ selectText('line3', 0, 10); |
+ verify("0", "11"); |
+ |
+ selectText('line3', 6, 10); |
+ verify("6", "11"); |
+ |
+ selectText('line3', 12, 23); |
+ verify("12", "24"); |
+} |
+ |
+function verify(start, end) { |
+ range = window.getSelection().getRangeAt(0); |
+ shouldBe("range.startOffset", start); |
+ shouldBe("range.endOffset", end); |
+ if (window.eventSender) { |
+ eventSender.mouseMoveTo(0, 0); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+} |
+ |
+function selectText(id, start, end) { |
+ var element = document.getElementById(id); |
+ var startPos = element.getStartPositionOfChar(start); |
+ startPos.y += (element.getBBox().height * 1.5); |
+ var endPos = element.getEndPositionOfChar(end); |
+ endPos.y += (element.getBBox().height * 1.5); |
+ var absStartPos = toAbsoluteCoordinates(startPos, element); |
+ var absEndPos = toAbsoluteCoordinates(endPos, element); |
+ if (window.eventSender) { |
+ eventSender.mouseMoveTo(absStartPos.x, absStartPos.y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseMoveTo(absEndPos.x, absEndPos.y); |
+ eventSender.mouseUp(); |
+ } |
+} |
+runTest(); |
+</script> |