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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-2.html

Issue 2260763002: Convert LayoutTests/svg/text/* js-tests.js tests to testharness.js based tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Align with review comments Created 4 years, 3 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3 text { 3 text {
4 font: 10px Arial; 4 font: 10px Arial;
5 } 5 }
6 </style> 6 </style>
7 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" width="400" height="400" viewBox="0 0 500 500" style="border: 1px solid black ;"> 7 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" width="400" height="400" viewBox="0 0 500 500" style="border: 1px solid black ;">
8 <g> 8 <g>
9 <text id="line1" x="10" y="30">Hello World. Hello, SVG.</text> 9 <text id="line1" x="10" y="30">Hello World. Hello, SVG.</text>
10 </g> 10 </g>
11 <g transform="translate(120, 30)"> 11 <g transform="translate(120, 30)">
12 <text id="line2" x="50" y="50">Hello World. Hello, SVG.</text> 12 <text id="line2" x="50" y="50">Hello World. Hello, SVG.</text>
13 </g> 13 </g>
14 <g transform="translate(240, 30)"> 14 <g transform="translate(240, 30)">
15 <text id="line3" x="100" y="100">Hello World. Hello, SVG.</text> 15 <text id="line3" x="100" y="100">Hello World. Hello, SVG.</text>
16 </g> 16 </g>
17 </svg> 17 </svg>
18 <script src="../../resources/js-test.js"></script> 18 <script src="../../resources/testharness.js"></script>
19 <script src="../../resources/testharnessreport.js"></script>
19 <script src="resources/SelectionTestCase.js"></script> 20 <script src="resources/SelectionTestCase.js"></script>
20 <script type="text/javascript"> 21 <script>
21 function getEndPosition(id, offset, gap) { 22 test(function() {
22 var element = document.getElementById(id); 23 var absEndPos = getEndPosition('line3', 10, { x : 0, y : 30});
23 var endPos = element.getEndPositionOfChar(offset); 24 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElemen tId: "line1", start: 7, endElementId: "line3", end: 11 });
24 endPos.x += gap.x;
25 endPos.y += gap.y;
26 var absEndPos = toAbsoluteCoordinates(endPos, element);
27 return absEndPos;
28 }
29 25
30 var absEndPos = getEndPosition('line3', 10, { x : 0, y : 30}); 26 absEndPos = getEndPosition('line2', 10, { x : 0, y : 30});
31 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementI d: "line1", start: "7", endElementId: "line3", end: "11" }); 27 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElemen tId: "line1", start: 7, endElementId: "line2", end: 11 });
32 28
33 absEndPos = getEndPosition('line2', 10, { x : 0, y : 30}); 29 absEndPos = getEndPosition('line3', 10, { x : 0, y : 30});
34 selectTextFromCharToPoint({ id: 'line1', offset: 7 }, absEndPos, { startElementI d: "line1", start: "7", endElementId: "line2", end: "11" }); 30 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElemen tId: "line2", start: 7, endElementId: "line3", end: 11 });
35 31
36 absEndPos = getEndPosition('line3', 10, { x : 0, y : 30}); 32 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30});
37 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementI d: "line2", start: "7", endElementId: "line3", end: "11" }); 33 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElemen tId: "line3", start: 7, endElementId: "line1", end: 9 });
38 34
39 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30}); 35 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30});
40 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementI d: "line3", start: "7", endElementId: "line1", end: "9" }); 36 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElemen tId: "line2", start: 7, endElementId: "line1", end: 9 });
41 37
42 absEndPos = getEndPosition('line1', 8, { x : 0, y : -30}); 38 absEndPos = getEndPosition('line2', 8, { x : 0, y : -30});
43 selectTextFromCharToPoint({ id: 'line2', offset: 7 }, absEndPos, { startElementI d: "line2", start: "7", endElementId: "line1", end: "9" }); 39 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElemen tId: "line3", start: 7, endElementId: "line2", end: 9 });
44 40 });
fs 2016/08/22 14:10:05 Ditto (like -1)
Shanmuga Pandi 2016/08/23 07:11:38 Done.
45 absEndPos = getEndPosition('line2', 8, { x : 0, y : -30});
46 selectTextFromCharToPoint({ id: 'line3', offset: 7 }, absEndPos, { startElementI d: "line3", start: "7", endElementId: "line2", end: "9" });
47 </script> 41 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698