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

Unified Diff: third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html

Issue 1636883003: Perform Spellcheck Requesting before Dispatching Events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..decfcf109e1bf0652d7d43cdf70d53733f6f4168
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="src">
+<div>Some text.</div>
+<div>Some other text.</div>
+</div>
+<div contenteditable="true" id="dest"></div>
+<div id="log"></div>
+<script>
+// A repro of crbug.com/580950, which crashes in debug build.
+document.body.onload = function() {
+ var src = document.getElementById('src');
+ var dest = document.getElementById('dest');
+ var sel = window.getSelection();
+ dest.addEventListener('webkitEditableContentChanged', () => dest.innerHTML = 'foo');
+
+ test(function() {
+ sel.setBaseAndExtent(src, 0, src, src.childNodes.length);
+ document.execCommand('copy');
+ dest.focus();
+ document.execCommand('paste');
+
+ assert_equals(dest.innerHTML, 'foo');
+ }, 'A pasting that fires a webkitEditableContentChanged event should not crash.');
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698