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

Unified 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: Better test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/selection/range-surroundContents-with-preceding-node-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html
diff --git a/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html b/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html
index d817d98d28eba8ba2e0515fc3ac5363fcd44d73e..18194989f0fc976abe010a04d3912d33fff8f679 100644
--- a/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html
+++ b/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html
@@ -2,26 +2,24 @@
<html>
<body>
<script src="../../fast/js/resources/js-test-pre.js"></script>
- <script>
- window.onload = function(){
- var range = document.createRange();
- var rootNode = document.getElementById("root");
- range.setStart(rootNode, 4);
- range.setEnd(rootNode, 6);
- var parentElement = document.getElementById("targetForSurround");
- range.surroundContents(parentElement);
-
- shouldBe(range.startContainer.id, rootNode.id);
- shouldBe(range.startOffset.toString(), "3");
- shouldBe(range.endContainer.id, rootNode.id);
- shouldBe(range.startOffset.toString(), "3");
- };
- </script>
- <script src="../../fast/js/resources/js-test-post.js"></script>
<div id="root">
<div id="targetForSurround"></div>
<div id="description">Test that there is no crash when surroundContents is called with a node preceding the current selection.</div>
<div id="trailingNode"></div>
</div>
+ <script>
+ var range = document.createRange();
+ var rootNode = document.getElementById("root");
+ range.setStart(rootNode, 4);
+ range.setEnd(rootNode, 6);
+ var parentElement = document.getElementById("targetForSurround");
+ range.surroundContents(parentElement);
+
+ shouldBe('range.startContainer.id', 'rootNode.id');
+ shouldBe('range.startOffset', '3');
+ shouldBe('range.endContainer.id', 'rootNode.id');
+ shouldBe('range.startOffset', '3');
+ </script>
+ <script src="../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
« 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