1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <title>Touch Adjustment : Fake mouse events not delivered when touching on a non-interactable node - bug
91012</title>
5 <style type=
"text/css">
11 <script type=
"text/javascript">
15 WebKit generates fake mouse events on each touch event, here we test if
16 the touch adjustment doesn't caused an early return not firing the fake
17 mouse events used here to unfocus a simple text input.
19 if (!window
.eventSender
|| !window
.testRunner
)
22 testRunner
.dumpAsText();
24 // Focus the text field
25 var textInput
= document
.getElementById("textInput");
26 if (document
.activeElement
=== textInput
)
29 if (document
.activeElement
!= textInput
)
32 // Try to lose the focus touching on a non-editable element.
33 var theDiv
= document
.getElementById("theDiv");
34 var w
= theDiv
.clientWidth
;
35 var h
= theDiv
.clientHeight
;
36 var x
= theDiv
.offsetLeft
+ w
/2;
37 var y
= theDiv
.offsetTop
+ h
/2;
39 eventSender
.gestureTap(x
, y
, 10, 10);
41 if (document
.activeElement
== document
.body
)
44 alert("FAILED, " + document
.activeElement
.id
+ " is focused.");
46 testRunner
.notifyDone();
51 <body onload=
"runTest()">
52 <div id=
"theDiv">You should see
"ALERT: PASS!"</div>
53 <input id=
"textInput" type=
"text" value=
"Touch me please!" />