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

Unified Diff: LayoutTests/fast/dom/Range/surroundContents-for-mutation.html

Issue 443103002: Range.insertNode should verify parent before setting end to it (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-mutation.html
diff --git a/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html b/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html
new file mode 100644
index 0000000000000000000000000000000000000000..a245ce2d63a6ed5594b92561cabbead8b39bafdf
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/surroundContents-for-mutation.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<div id='container'>
+ <p id='start'>start</p>
+ <iframe id='test'></iframe>
+ <p id='end'>end</p>
+</div>
+<script>
+var range = document.createRange();
+var start = document.getElementById('start');
+range.setStart(start.firstChild, 0);
+range.setEnd(start.firstChild, 0);
+
+function loaded() {
+ var srcElement = event.srcElement;
Yuta Kitamura 2014/08/07 09:30:41 Does this work? You have to receive the event as t
kangil_ 2014/08/07 09:59:50 Please refer to https://code.google.com/p/chromium
Yuta Kitamura 2014/08/08 04:27:55 No, that's not .srcElement I'm talking about. I'm
kangil_ 2014/08/08 04:52:25 I will add event argument in next patch.
+ range.surroundContents(document.getElementById('end'));
+ srcElement.outerHTML = '';
+}
+document.addEventListener("load", loaded, true);
+
+var testFrame = document.getElementById('test');
+shouldThrow("range.surroundContents(testFrame)", '"HierarchyRequestError: Failed to execute \'surroundContents\' on \'Range\': This operation would set range\'s end to parent with new offset, but there\'s no parent into which to continue."');
+
+if (window.testRunner)
+ document.getElementById('container').outerHTML = '';
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Range/surroundContents-for-mutation-expected.txt » ('j') | Source/core/dom/Range.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698