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

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: Take review comment into consideration 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 = '';
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/surroundContents-for-invalid-state-error-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698