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

Unified Diff: LayoutTests/editing/undo/undo-after-event-edited.html

Issue 14829006: Use after free in WebCore::dispatchEditableContentChangedEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix formatting. remove unneeded exception handlers. simplify calculations Created 7 years, 7 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/editing/undo/undo-after-event-edited-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/undo/undo-after-event-edited.html
diff --git a/LayoutTests/editing/undo/undo-after-event-edited.html b/LayoutTests/editing/undo/undo-after-event-edited.html
new file mode 100644
index 0000000000000000000000000000000000000000..ef16b4c33e167723b03ce32b5fdbbd9033107cca
--- /dev/null
+++ b/LayoutTests/editing/undo/undo-after-event-edited.html
@@ -0,0 +1,56 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+* { display:run-in; }
+.collapse { visibility:collapse; }
+</style>
+<script>
+
+if (window.testRunner) {
+ window.testRunner.dumpAsText();
+ window.testRunner.waitUntilDone();
+}
+
+document.designMode = "on";
+var scriptElements = document.getElementsByTagName("script");
+scriptElements[0].parentNode.removeChild(scriptElements[0]);
+var eventHandlerActive = false;
+
+function event_handler_webkitEditableContentChanged() {
+ if (eventHandlerActive)
+ return;
+ eventHandlerActive = true;
+ var srcElement = event.srcElement;
+ document.execCommand('InsertText',false,'dummy text');
+ srcElement.textContent = "Pass. Test didn't crash.";
+ eventHandlerActive = false;
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+}
+
+document.addEventListener("webkitEditableContentChanged", event_handler_webkitEditableContentChanged, true);
+
+function event_handler_DOMCharacterDataModified() {
+ document.execCommand('InsertParagraph',false,false);
+}
+
+document.addEventListener("DOMCharacterDataModified", event_handler_DOMCharacterDataModified, false);
+
+setTimeout(function() {
+ var selection=window.getSelection();
+ document.execCommand("SelectAll", false)
+ var range = selection.getRangeAt(0);
+ var documentFragment = range.extractContents();
+ document.execCommand('Undo',false);
+}, 1);
+</script>
+</head>
+<body>
+<table class="collapse">
+<caption>
+original text
+</caption>
+</table>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/undo/undo-after-event-edited-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698