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

Side by Side Diff: LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html

Issue 25571006: Fix out-of-date offset in selection range code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed the test. Ready to commit. Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/editing/selection/range-surroundContents-with-preceding-node-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../fast/js/resources/js-test-pre.js"></script>
5 <script>
6 window.onload = function(){
7 var range = document.createRange();
8 var rootNode = document.getElementById("root");
9 range.setStart(rootNode, 4);
10 range.setEnd(rootNode, 6);
11 var parentElement = document.getElementById("targetForSurround");
12 range.surroundContents(parentElement);
13
14 shouldBe(range.startContainer.id, rootNode.id);
15 shouldBe(range.startOffset.toString(), "3");
yosin_UTC9 2013/10/04 01:26:36 nit: It is better to write shouldBe('range.startOf
16 shouldBe(range.endContainer.id, rootNode.id);
17 shouldBe(range.startOffset.toString(), "3");
18 };
19 </script>
20 <script src="../../fast/js/resources/js-test-post.js"></script>
21 <div id="root">
22 <div id="targetForSurround"></div>
23 <div id="description">Test that there is no crash when surroundContents is called with a node preceding the current selection.</div>
24 <div id="trailingNode"></div>
25 </div>
26 </body>
27 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/selection/range-surroundContents-with-preceding-node-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698