OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body onload="test()"> | 3 <body onload="test()"> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script src="../resources/common.js"></script> | 5 <script src="../resources/common.js"></script> |
6 | 6 |
7 <form id="form"> | 7 <form id="form"> |
8 <select size="10" id="listbox"> | 8 <select size="10" id="listbox"> |
9 <optgroup label="Enabled" id="listbox_optgroup_enabled"> | 9 <optgroup label="Enabled" id="listbox_optgroup_enabled"> |
10 <option value="listbox_e1" id="listbox_option_enabled">One</option> | 10 <option value="listbox_e1" id="listbox_option_enabled">One</option> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 testRunner.dumpAsText(); | 56 testRunner.dumpAsText(); |
57 | 57 |
58 debug("\nClick enabled option"); | 58 debug("\nClick enabled option"); |
59 $("listbox").selectedIndex = 2; | 59 $("listbox").selectedIndex = 2; |
60 mouseMoveToIndexInListbox(1 + 1, 'listbox'); // +1 for optgroup | 60 mouseMoveToIndexInListbox(1 + 1, 'listbox'); // +1 for optgroup |
61 eventSender.mouseDown(); | 61 eventSender.mouseDown(); |
62 eventSender.mouseUp(); | 62 eventSender.mouseUp(); |
63 shouldBe('$("listbox").selectedIndex', '1'); | 63 shouldBe('$("listbox").selectedIndex', '1'); |
64 | 64 |
| 65 debug("\nClick on optgroup, should not deselect selectedIndex"); |
| 66 mouseMoveToIndexInListbox(0, 'listbox'); // Select on optgroup |
| 67 eventSender.mouseDown(); |
| 68 eventSender.mouseUp(); |
| 69 shouldBe('$("listbox").selectedIndex', '1'); |
| 70 |
65 debug("\nClick disabled option - doesn't change selectedIndex"); | 71 debug("\nClick disabled option - doesn't change selectedIndex"); |
66 mouseMoveToIndexInListbox(5 + 2, 'listbox'); // +2 for optgroup's | 72 mouseMoveToIndexInListbox(5 + 2, 'listbox'); // +2 for optgroup's |
67 eventSender.mouseDown(); | 73 eventSender.mouseDown(); |
68 eventSender.mouseUp(); | 74 eventSender.mouseUp(); |
69 shouldBe('$("listbox").selectedIndex', '1'); | 75 shouldBe('$("listbox").selectedIndex', '1'); |
70 | 76 |
71 debug("\nMenu list with arrow key"); | 77 debug("\nMenu list with arrow key"); |
72 $("menulist").selectedIndex = 3; | 78 $("menulist").selectedIndex = 3; |
73 $("menulist").focus(); | 79 $("menulist").focus(); |
74 eventSender.keyDown("downArrow"); | 80 eventSender.keyDown("downArrow"); |
75 eventSender.keyDown("\n"); | 81 eventSender.keyDown("\n"); |
76 shouldBe('$("menulist").selectedIndex', '8'); | 82 shouldBe('$("menulist").selectedIndex', '8'); |
77 | 83 |
78 finishJSTest(); | 84 finishJSTest(); |
79 } | 85 } |
80 </script> | 86 </script> |
81 </body> | 87 </body> |
82 </html> | 88 </html> |
OLD | NEW |