4 return document.getElementById(id);
7 function testGetComputedStyle(el) {
8 return el.ownerDocument.defaultView.getComputedStyle(el);
12 var default_op = $('default-select').options[0];
13 var size0_op = $('size0-select').options[0];
14 var size1_op = $('size1-select').options[0];
16 var default_color = testGetComputedStyle(default_op)['background-color'];
17 var size0_color = testGetComputedStyle(size0_op)['background-color'];
18 var size1_color = testGetComputedStyle(size1_op)['background-color'];
20 $('result').textContent =
21 (default_color == size0_color && default_color == size1_color) ? "PASS"
23 if (window.layoutTestController)
24 layoutTestController.dumpAsText();
27 <body onload='test();'>
28 This test verifies that the dropdown background colors of <select> and <select size="0"|"1"> are consistent. You should see PASS below if test passes. Otherwise, FAIL shows up.
29 <div id='result'>Oops</div>
32 <select id='default-select'>
33 <option>Item 1</option>
34 <option>Item 2</option>
38 <select size="0" id='size0-select'>
39 <option>Item 1</option>
40 <option>Item 2</option>
44 <select size="1" id='size1-select'>
45 <option>Item 1</option>
46 <option>Item 2</option>
50 Note: Two items are used so that you could manually see the difference. The test logic only needs the first item to run.