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 |