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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <div id="sample"></div>
5 <div id="log"></div>
6 <script>
7 var moved = false;
8 var sample = document.getElementById('sample');
9 var range = document.createRange();
10 range.setStart(sample, 0);
11 range.setEnd(sample, 0);
12 sample.addEventListener('DOMNodeRemoved', function() {
13 if (moved)
14 return;
15 moved = true;
16 document.implementation.createDocument('', null).appendChild(sample);
17 });
18 test(function() {
19 var doc = document.implementation.createDocument('http://www.w3.org/1999/xht ml', 'html');
20 try {
21 doc.documentElement.appendChild(sample);
22 } catch (exception) {
23 assert_equals(exception.toString(), 'NotFoundError: Failed to execute \' appendChild\' on \'Node\': The node to be removed is no longer a child of this n ode. Perhaps it was moved in response to a mutation?');
24 }
25 });
26 </script>
OLDNEW
« 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