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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <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 500 500" style="border: 1 px solid black;">
3 <g>
4 <text id="line1" x="10" y="30" font-family="Arial" font-size="10" fill="blac k">Hello World. Hello, SVG.</text>
5 </g>
6 <g transform="translate(120, 30)">
7 <text id="line2" x="50" y="50" font-family="Arial" font-size="10" fill="blac k">Hello World. Hello, SVG.</text>
8 </g>
9 <g transform="translate(240, 30)">
10 <text id="line3" x="100" y="100" font-family="Arial" font-size="10" fill="bl ack">Hello World. Hello, SVG.</text>
11 </g>
12 </svg>
13 <script src="../../resources/js-test.js"></script>
14 <script src="resources/SelectionTestCase.js"></script>
15 <script type="text/javascript">
16 function getEndPosition(id, offset, gap) {
17 var element = document.getElementById(id);
18 var endPos = element.getEndPositionOfChar(offset);
19 endPos.x += gap.x;
20 endPos.y += gap.y;
21 var absEndPos = toAbsoluteCoordinates(endPos, element);
22 return absEndPos;
23 }
24
25 var absEndPos = getEndPosition('line3', 10, { x : 0, y : 30});
26 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementI d: "line1", start: "7", endElementId: "line3", end: "11" });
27
28 absEndPos = getEndPosition('line2', 10, { x : 0, y : 30});
29 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementI d: "line1", start: "7", endElementId: "line2", end: "11" });
30
31 absEndPos = getEndPosition('line3', 10, { x : 0, y : 30});
32 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementI d: "line2", start: "7", endElementId: "line3", end: "11" });
33
34 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30});
35 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementI d: "line3", start: "7", endElementId: "line1", end: "9" });
36
37 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30});
38 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementI d: "line2", start: "7", endElementId: "line1", end: "9" });
39
40 absEndPos = getEndPosition('line2', 8, { x : 0, y : -30});
41 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementI d: "line3", start: "7", endElementId: "line2", end: "9" });
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698