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

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: Add test case 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
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..106ba2f085521ed6b448115e451f005e80be1785
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/paste-webkit-editable-content-changed-crash.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+
yosin_UTC9 2016/01/27 06:02:38 nit: We don't need to have an extra blank line.
Xiaocheng 2016/01/27 07:20:37 Done.
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
yosin_UTC9 2016/01/27 06:02:38 nit: We don't need to have an extra blank line.
Xiaocheng 2016/01/27 07:20:37 Done.
+<div id="src">
+<div>Some text.</div>
+<div>Some other text.</div>
+</div>
+
yosin_UTC9 2016/01/27 06:02:38 nit: We don't need to have an extra blank line.
Xiaocheng 2016/01/27 07:20:37 Done.
+<div contenteditable="true" id="dest">
+</div>
+
yosin_UTC9 2016/01/27 06:02:38 nit: We don't need to have an extra blank line.
Xiaocheng 2016/01/27 07:20:37 Done.
+<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', function() { dest.innerHTML='' });
yosin_UTC9 2016/01/27 06:02:38 nit: Should be multiple lines. nit: Need spaces ar
Xiaocheng 2016/01/27 07:20:37 Done.
+
+ test(function() {
+ sel.setBaseAndExtent(src, 0, src, src.childNodes.length);
+ document.execCommand('copy');
+ dest.focus();
+ document.execCommand('paste');
+
+ assert_equals(dest.innerHTML, '');
+ }, 'A pasting that fires a webkitEditableContentChanged event should not crash.');
+
+ src.style.display = "none";
yosin_UTC9 2016/01/27 06:02:38 Add <div id="log"></div> instead of hide output.
Xiaocheng 2016/01/27 07:20:37 Ah I didn't know this. Done.
+ dest.style.display = "none";
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.h » ('j') | third_party/WebKit/Source/core/editing/Editor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698