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

Unified Diff: LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html

Issue 441853003: Range.surroundContents should throw InvalidStateError if a non-Text node is partially contained (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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/fast/dom/Range/surroundContents-for-invalid-state-error.html
diff --git a/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html b/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html
new file mode 100644
index 0000000000000000000000000000000000000000..a9da9ac3f23feca3109fa553fa9a0e74dab3beb5
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<div id='test'>
+ <p id='start'>start</p>
+ <p id='end'>end</p>
+</div>
+<script>
+var range = document.createRange();
+var start = document.getElementById('start');
+var end = document.getElementById('end');
+range.setStart(start.firstChild, 0);
+range.setEnd(end.firstChild, 0);
+
+shouldThrow("range.surroundContents(start)", '"InvalidStateError: Failed to execute \'surroundContents\' on \'Range\': The Range has partially selected a non-Text node."');
+
+if (window.testRunner)
+ document.getElementById('test').outerHTML = '';
haraken 2014/08/05 06:34:10 What is this code for?
kangil_ 2014/08/05 06:49:58 This will clean 'start' and 'end' from the result.
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698