4 <script src=
"../../../fast/forms/resources/picker-common.js"></script>
12 // We need to 'click' the select element by sending an actual event
13 // through internals, since the regular javascript click() method
14 // won't trigger the right events for this test.
15 function clickSelect(callback
) {
16 if (!window
.eventSender
)
19 var select
= document
.getElementById('select');
20 // FIXME: it would be really nice to use getBoundingClientRect() and not
21 // hard-code pixel coordinates here, but since it's in an iframe, the
22 // coordinates are translated anyway.
23 clickToOpenPicker(50, 120, callback
, function () {
24 setTimeout(callback
, 0);
28 // We'll get a message from the outer frame when it's done scrolling,
29 // so we know it's time to click on a select element.
30 window
.onmessage = function() {
31 clickSelect(function () {
32 if (window
.testRunner
)
33 window
.testRunner
.notifyDone();
37 // This function just saves us from hard-coding 30 select elements
38 // (each with a few option elements) in the body. One of the
39 // select elements near the bottom is given an id so we can click
41 function populateDom() {
42 for (var x
= 0; x
< 30; x
++) {
43 var select
= document
.createElement('select');
44 for (var y
= 0; y
< 4; ++y
) {
45 var option
= document
.createElement('option');
47 select
.appendChild(option
);
54 document
.body
.appendChild(select
);
58 // Javascript execution starts here. This will populate the iframe
59 // with a bunch of select elements, then post a message to the
60 // outer iframe to tell it to scroll.
61 window
.onload = function() {
63 parent
.postMessage('', '*');