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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/text/selection-dragging-outside-1.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 <style>
3 text {
4 font: 10px Arial;
5 }
6 </style>
7 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin k" width="400" height="400" style="border: 1px solid black;">
8 <g>
9 <text id="firsttext" x="130" y="30">Happy, Web</text>
10 <text id="middletext" x="130" y="50">Happy, SVG</text>
11 <text id="endtext" x="130" y="70">Happy, ;)link</text>
12 </g>
13 <text id="line" x="130" y="150">Hello World. Hello, SVG.</text>
14 </svg>
15 <script src="../../resources/js-test.js"></script>
16 <script src="resources/SelectionTestCase.js"></script>
17 <script type="text/javascript">
18 function getEndPosition(id, offset, gap) {
19 var element = document.getElementById(id);
20 var endPos = element.getEndPositionOfChar(offset);
21 endPos.x += gap.x;
22 endPos.y += gap.y;
23 var absEndPos = toAbsoluteCoordinates(endPos, element);
24 return absEndPos;
25 }
26
27 selectTextFromCharToPoint({ id: 'line', offset: 0 }, { x: 400, y: 400 }, { start ElementId: 'line', start: "0", endElementId: "line", end: "24" });
28 selectTextFromCharToPoint({ id: 'line', offset: 7 }, { x: 400, y: 400 }, { start ElementId: "line", start: "7", endElementId: "line", end: "24" });
29
30 var absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 0});
31 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "firsttext", end: "4"});
32 absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 10});
33 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "middletext", end: "4"});
34 absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 20});
35 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "middletext", end: "4"});
36 absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 30});
37 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
38 absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 40});
39 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
40 absEndPos = getEndPosition('firsttext', 3, { x : 0, y : 50});
41 selectTextFromCharToPoint({ id: 'firsttext', offset: 0 }, absEndPos, { startElem entId: 'firsttext', start: "0", endElementId: "endtext", end: "4"});
42
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698