Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-3.html

Issue 1541083002: Fix invalid selection produced when dragging mouse outside the SVG text element (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-3.html
diff --git a/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-3.html b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-3.html
new file mode 100644
index 0000000000000000000000000000000000000000..48723b310faed15e47ce729ab103ab9cc881b0d2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-3.html
@@ -0,0 +1,37 @@
+<!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 350 350" style="border: 1px solid black;">
+ <g>
+ <text x="10" y="70" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text>
+ </g>
+ <g transform="translate(50, 50)">
+ <g transform="rotate(20) scale(2)">
+ <text id="line1" x="10" y="70" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text>
fs 2016/02/15 14:11:24 Maybe consider using text content of differing len
hyunjunekim2 2016/02/15 16:08:12 Done.
+ <text id="line2" x="10" y="80" font-family="Arial" font-size="10" fill="black">Hello World. Hello, SVG.</text>
+ </g>
+ </g>
+</svg>
+<script src="../../resources/js-test.js"></script>
+<script src="resources/SelectionTestCase.js"></script>
+<script type="text/javascript">
+function getEndPosition(id, offset, gap) {
+ var element = document.getElementById(id);
+ var endPos = element.getEndPositionOfChar(offset);
+ endPos.x += gap.x;
+ endPos.y += gap.y;
+ var absEndPos = toAbsoluteCoordinates(endPos, element);
+ return absEndPos;
+}
+
+var absEndPos = getEndPosition('line1', 10, { x : 0, y : -20});
+selectTextFromCharToPoint({ id: 'line1', offset: 0 }, absEndPos, { startElementId: "line1", start: "0", endElementId: "line1", end: "11" });
+absEndPos = getEndPosition('line1', 23, { x : 0, y : -20});
+selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementId: "line1", start: "7", endElementId: "line1", end: "24" });
+absEndPos = getEndPosition('line2', 10, { x : 0, y : 20});
+selectTextFromCharToPoint({ id: 'line2', offset: 0 }, absEndPos, { startElementId: "line2", start: "0", endElementId: "line2", end: "11" });
+absEndPos = getEndPosition('line2', 23, { x : 0, y : 20});
+selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementId: "line2", start: "7", endElementId: "line2", end: "24" });
+absEndPos = getEndPosition('line2', 10, { x : 0, y : 20});
+selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementId: "line1", start: "7", endElementId: "line2", end: "11" });
+absEndPos = getEndPosition('line1', 20, { x : 0, y : -20});
+selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementId: "line2", start: "7", endElementId: "line1", end: "21" });
+</script>

Powered by Google App Engine
This is Rietveld 408576698