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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/Selection/getRangeAt.html

Issue 2712603003: Move tests in fast/dom/Selection/ to editing/selection/. (Closed)
Patch Set: Created 3 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 PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8 description("Test to make sure that getRangeAt does not modify the range when re turning it.")
9
10 var div = document.createElement('div');
11 document.body.appendChild(div);
12 var textNode = document.createTextNode("asd");
13 div.appendChild(textNode);
14
15 var sel = window.getSelection();
16 sel.collapse(textNode, 0);
17 var range = sel.getRangeAt(0);
18
19 var result = range.comparePoint(textNode, 0);
20 if (result == 0) {
21 testPassed("range is correctly (text, 0)");
22 } else {
23 testFailed("range did not match (text, 0)");
24 debug("window.getSelection():");
25 debug("anchorNode: " + sel.anchorNode);
26 debug("anchorOffset: " + sel.anchorOffset);
27 debug("focusNode: " + sel.focusNode);
28 debug("focusOffset: " + sel.focusOffset);
29
30 debug("window.getSelection().getRangeAt(0):");
31 debug("startContainer: " + range.startContainer);
32 debug("startOffset: " + range.startOffset);
33 debug("endContainer: " + range.endContainer);
34 debug("endOffset: " + range.endOffset);
35 }
36
37 // Clean up after ourselves
38 document.body.removeChild(div);
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698