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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html

Issue 2646653002: Fix crash in mouse event handling with a dirty layout tree. (Closed)
Patch Set: Created 3 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/input/MouseEventManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html b/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html
new file mode 100644
index 0000000000000000000000000000000000000000..d131a024a044a0e70de554a1f42903b189fa9722
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/selection/select-delete-in-event-handler.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html> Passes if it does not crash.
+
+<body dir="rtl">
+</body>
+<script type="text/javascript">
chrishtr 2017/01/18 23:16:21 I spent quite a while reducing the unminimized Clu
+function selectionChangeHandler() {
+ document.designMode = "on";
+}
+document.addEventListener("selectionchange", selectionChangeHandler, true);
+
+var focusInActive = false;
+
+function focusInHandler() {
+ if (focusInActive)
+ return;
+ focusInActive = true;
+ var oElement = event.srcElement;
+ oElement.innerHTML = 'a';
+ document.execCommand("SelectAll", false, false);
+}
+
+function cleanup() {
+ while (true) {
+ var oe = document.getElementsByTagName("*");
+ if (oe.length <= 1)
+ return;
+ for (var i = 0; i < oe.length; i++) {
+ var o = oe.item(i);
+ if (!o.firstElementChild && o != document.documentElement) {
+ var p = o.parentNode;
+ p.replaceChild(document.createTextNode(
+ "<" + o.tagName + ">" + o.textContent + "</" + o.tagName + ">"), o);
+ }
+ }
+ }
+}
+
+window.onload = function() {
+ cleanup();
+ document.addEventListener("DOMFocusIn", focusInHandler, false);
+
+ setTimeout(function() {
+ if (eventSender) {
+ eventSender.mouseMoveTo(100, 100);
+ eventSender.mouseDown();
+ setTimeout(function() {
+ eventSender.mouseMoveTo(100, 101);
+ eventSender.mouseUp();
+ if (testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }
+ }, 0);
+};
+
+if (testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/MouseEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698