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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html

Issue 2042333006: Reset drag state variables on mouse up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/fast/events/mouse-up-preventDefault-dragstate.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html b/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html
new file mode 100644
index 0000000000000000000000000000000000000000..5d4db2a8331f0444ba916fd1b2c8c88ae8e6cc83
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html
@@ -0,0 +1,47 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<body onload="runTest()">
+
+<style>
+#target {
+ width: 200px;
+ height: 200px;
+}
+</style>
+
+<p>This is the top level window.</p>
+<p>Click somewhere. Move the mouse into the iframe.</p>
+<p>Mouse move should be received by the iframe.</p>
+<iframe id="target" srcdoc="
+<p>This is the iframe.</p>
+<script>
+ document.addEventListener('mousemove', function() {
+ parent.mouseMoveReceived();
+ });
+</script>
+"></iframe>
+
+<script type="text/javascript">
+ var test_mousemove = async_test("Inner frame should receive mousemove even when mouseup preventDefault was called in the parent iframe.");
+ var state = 0;
+ function mouseMoveReceived() {
+ if (state == 1)
+ test_mousemove.done();
+ }
+ document.addEventListener("mouseup", function(e) {
+ e.preventDefault();
+ state = 1;
+ });
+
+ function runTest() {
+ if (window.eventSender) {
+ var targetRect = document.getElementById("target").getBoundingClientRect();
+ eventSender.mouseMoveTo(targetRect.right+10, targetRect.bottom+10);
+ eventSender.mouseDown(0);
+ eventSender.mouseUp(0);
+ eventSender.mouseMoveTo(targetRect.right-10, targetRect.bottom-10);
+ }
+ }
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698