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

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: Test with description. 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
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
new file mode 100644
index 0000000000000000000000000000000000000000..d73f16ac571e05774d5413a0cbbf78ba422d346e
--- /dev/null
+++ b/LayoutTests/editing/selection/range-surroundContents-with-preceding-node.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <script>
+ window.onload = function(){
+ var oSelection=window.getSelection();
yosin_UTC9 2013/10/03 01:41:19 nit: indentation of JavaScript should be four spac
yosin_UTC9 2013/10/03 01:41:19 Could you populate Range object by script rather t
Stephen Chennney 2013/10/03 20:38:28 Done.
+ document.execCommand("SelectAll", false);
+ var oRange = oSelection.getRangeAt(0);
+ var aoElements = document.getElementsByTagName("*");
+ var oParentElement = aoElements[5];
ojan 2013/10/03 02:15:15 It would be easier to understand what this test is
Stephen Chennney 2013/10/03 20:38:28 Done.
+ oRange.surroundContents(oParentElement);
+
+ var descriptionNode = document.createElement("p");
+ descriptionNode.id = "description";
+ descriptionNode.innerHTML = "Test that there is no crash when surroundContents is called with a node preceding the current selection.";
+ var buttonNode = document.getElementById("root");
+ buttonNode.insertBefore(descriptionNode, buttonNode.firstChild);
+ Markup.dump("root");
ojan 2013/10/03 02:15:15 Can you call Markup.dump before you insert the des
Stephen Chennney 2013/10/03 20:38:28 Switched to js-tests.
+ };
+ </script>
+ <button id="root">
+ <div></div>
+ <div></div>
+ <table></table>
+ </button>
+ <script src="../../resources/dump-as-markup.js"></script>
yosin_UTC9 2013/10/03 01:41:19 It is better to use js-test-pre.js rather than dum
Stephen Chennney 2013/10/03 20:38:28 Done.
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698