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

Unified Diff: trunk/LayoutTests/fast/forms/select-list-box-mouse-focus.html

Issue 1184693003: Revert 196987 "Don't invoke default actions for MouseEvents gene..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 5 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: trunk/LayoutTests/fast/forms/select-list-box-mouse-focus.html
===================================================================
--- trunk/LayoutTests/fast/forms/select-list-box-mouse-focus.html (revision 197019)
+++ trunk/LayoutTests/fast/forms/select-list-box-mouse-focus.html (working copy)
@@ -4,17 +4,11 @@
if (window.testRunner)
testRunner.dumpAsText();
var select = document.getElementById("select");
- var rect = select.getBoundingClientRect();
- var x = rect.left + 10;
- var y = rect.top + 10;
-
- if (!eventSender) {
- alert('Click the select to run the test.');
- return;
- }
-
- eventSender.mouseMoveTo(x, y);
- eventSender.mouseDown(0);
+ var x = select.clientLeft + 10;
+ var y = select.clientTop + 10;
+ var event = document.createEvent("MouseEvent");
+ event.initMouseEvent("mousedown", true, true, document.defaultView, 1, x, y, x, y, false, false, false, false, 0, document);
+ select.dispatchEvent(event);
}
function reportFocus()
{
@@ -22,7 +16,7 @@
}
</script>
<body onload="test()">
-<p>The select below should be focused once clicked.</p>
+<p>The select below should be focused because we dispatched a mouse down event to it.</p>
<p id="result">FAIL</p>
<select id="select" size="4" onfocus="reportFocus()">
<option>one</option>
Property changes on: trunk/LayoutTests/fast/forms/select-list-box-mouse-focus.html
___________________________________________________________________
Modified: svn:eol-style
## -1 +1 ##
-LF
\ No newline at end of property
+native
\ No newline at end of property

Powered by Google App Engine
This is Rietveld 408576698