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

Unified Diff: LayoutTests/fast/dom/Range/range-dom-node-removed-assert.html

Issue 1297593004: Don't call Document::nodeWillRemoved() with a node in different document (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-18T17:03:20 Changes for review comments Created 5 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 | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Range/range-dom-node-removed-assert.html
diff --git a/LayoutTests/fast/dom/Range/range-dom-node-removed-assert.html b/LayoutTests/fast/dom/Range/range-dom-node-removed-assert.html
new file mode 100644
index 0000000000000000000000000000000000000000..6e2b2f14d51ba4f7ab15992f5ae18612fc3f7794
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/range-dom-node-removed-assert.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="sample"></div>
+<div id="log"></div>
+<script>
+var moved = false;
+var sample = document.getElementById('sample');
+var range = document.createRange();
+range.setStart(sample, 0);
+range.setEnd(sample, 0);
+sample.addEventListener('DOMNodeRemoved', function() {
+ if (moved)
+ return;
+ moved = true;
+ document.implementation.createDocument('', null).appendChild(sample);
+});
+test(function() {
+ var doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html');
+ try {
+ doc.documentElement.appendChild(sample);
+ } catch (exception) {
+ assert_equals(exception.toString(), 'NotFoundError: Failed to execute \'appendChild\' on \'Node\': The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?');
+ }
+});
+</script>
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698