| return document.getElementById(id); |
| function testGetComputedStyle(el) { |
| return el.ownerDocument.defaultView.getComputedStyle(el); |
| var default_op = $('default-select').options[0]; |
| var size0_op = $('size0-select').options[0]; |
| var size1_op = $('size1-select').options[0]; |
| var default_color = testGetComputedStyle(default_op)['background-color']; |
| var size0_color = testGetComputedStyle(size0_op)['background-color']; |
| var size1_color = testGetComputedStyle(size1_op)['background-color']; |
| $('result').textContent = |
| (default_color == size0_color && default_color == size1_color) ? "PASS" |
| 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. |
| <div id='result'>Oops</div> |
| <select id='default-select'> |
| <select size="0" id='size0-select'> |
| <select size="1" id='size1-select'> |
| Note: Two items are used so that you could manually see the difference. The test logic only needs the first item to run. |