Index: LayoutTests/fast/forms/select-list-box-mouse-focus.html |
diff --git a/LayoutTests/fast/forms/select-list-box-mouse-focus.html b/LayoutTests/fast/forms/select-list-box-mouse-focus.html |
index 50326506db8afd361e53eeb56121e709061d1a83..19aeb645685d5927a84556425c5843a734420717 100644 |
--- a/LayoutTests/fast/forms/select-list-box-mouse-focus.html |
+++ b/LayoutTests/fast/forms/select-list-box-mouse-focus.html |
@@ -4,11 +4,17 @@ function test() |
if (window.testRunner) |
testRunner.dumpAsText(); |
var select = document.getElementById("select"); |
- 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); |
+ 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); |
} |
function reportFocus() |
{ |
@@ -16,7 +22,7 @@ function reportFocus() |
} |
</script> |
<body onload="test()"> |
-<p>The select below should be focused because we dispatched a mouse down event to it.</p> |
+<p>The select below should be focused once clicked.</p> |
<p id="result">FAIL</p> |
<select id="select" size="4" onfocus="reportFocus()"> |
<option>one</option> |