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

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: Add comments 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()">
bokan 2016/07/01 19:27:29 nit: omit body tag, use window.onload or addEventL
Navid Zolghadr 2016/07/04 14:58:11 Done.
+
+<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">
bokan 2016/07/01 19:27:29 nit: no need for `type` attribute
Navid Zolghadr 2016/07/04 14:58:11 Done.
+ var test_mousemove = async_test("Inner frame should receive mousemove even when mouseup preventDefault was called in the parent iframe.");
bokan 2016/07/01 19:27:29 nit: s/called in the parent iframe/called in the p
Navid Zolghadr 2016/07/04 14:58:11 Done.
+ var state = 0;
bokan 2016/07/01 19:27:29 nit: state -> mouseUpPrevented or similar and make
Navid Zolghadr 2016/07/04 14:58:11 Done.
+ 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>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698