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

Unified Diff: LayoutTests/editing/inserting/insert-with-mutation-event.html

Issue 141103006: Protect document.execCommand() from recursive call and DOM mutation events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2014-02-03T14:21:08 Created 6 years, 11 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/editing/inserting/insert-with-mutation-event.html
diff --git a/LayoutTests/editing/inserting/insert-with-mutation-event.html b/LayoutTests/editing/inserting/insert-with-mutation-event.html
new file mode 100644
index 0000000000000000000000000000000000000000..e4c5d97174b3fa2806659e4c8e65a4257a7cf688
--- /dev/null
+++ b/LayoutTests/editing/inserting/insert-with-mutation-event.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<body>
+<div id="sample" contenteditable="true">
+foo
+<div id="test" style="font-weight:bold">bar</div>
+</div>
+</body>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+function $(id) { return document.getElementById(id); }
+window.getSelection().collapse($('test'), 0);
+document.execCommand('Delete');
+var sample = $('sample');
+sample.addEventListener('DOMSubtreeModified', function () {
+ // Move nodes being processed by 'InsertText' to another document.
+ var anotherDoc = document.implementation.createDocument('', null);
+ anotherDoc.adoptNode(sample);
+});
+document.execCommand('InsertText', false, 'ab123cd');
+document.body.textContent = 'PASS; NOT CRASHED';
+</script>

Powered by Google App Engine
This is Rietveld 408576698