| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <p id="description"></p> | 7 <p id="description"></p> |
| 8 <div id="console"></div> | 8 <div id="console"></div> |
| 9 <script> | 9 <script> |
| 10 description('<select> selection test for scrolling.'); | 10 description('<select> selection test for scrolling.'); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 sl1.removeAttribute('size'); | 43 sl1.removeAttribute('size'); |
| 44 var height = itemHeight * 9 + 9; | 44 var height = itemHeight * 9 + 9; |
| 45 sl1.setAttribute('style', 'height: ' + height + 'px; border: 10px solid; padding
: 5px;'); | 45 sl1.setAttribute('style', 'height: ' + height + 'px; border: 10px solid; padding
: 5px;'); |
| 46 | 46 |
| 47 function mouseDownOnSelect(selId, index) | 47 function mouseDownOnSelect(selId, index) |
| 48 { | 48 { |
| 49 var sl = document.getElementById(selId); | 49 var sl = document.getElementById(selId); |
| 50 var borderPaddingTop = 15; | 50 var borderPaddingTop = 15; |
| 51 var borderPaddingLeft = 15; | 51 var borderPaddingLeft = 15; |
| 52 var y = index * itemHeight + itemHeight / 3 - window.pageYOffset + borderPad
dingTop; | 52 var y = index * itemHeight + itemHeight / 3 - window.pageYOffset + borderPad
dingTop; |
| 53 var event = document.createEvent("MouseEvent"); | 53 eventSender.mouseMoveTo(sl.offsetLeft + borderPaddingLeft, sl.offsetTop + y
); |
| 54 event.initMouseEvent("mousedown", true, true, document.defaultView, 1, sl.of
fsetLeft + borderPaddingLeft, sl.offsetTop + y, sl.offsetLeft + borderPaddingLe
ft, sl.offsetTop + y, false, false, false, false, 0, document); | 54 eventSender.mouseDown(); |
| 55 sl.dispatchEvent(event); | 55 eventSender.mouseUp(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 function selectionPattern(selectId) | 58 function selectionPattern(selectId) |
| 59 { | 59 { |
| 60 var select = document.getElementById(selectId); | 60 var select = document.getElementById(selectId); |
| 61 var result = ""; | 61 var result = ""; |
| 62 for (var i = 0; i < select.options.length; i++) | 62 for (var i = 0; i < select.options.length; i++) |
| 63 result += select.options[i].selected ? '1' : '0'; | 63 result += select.options[i].selected ? '1' : '0'; |
| 64 return result; | 64 return result; |
| 65 } | 65 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 90 shouldBe('selectionPattern("sl2")', '"010"'); | 90 shouldBe('selectionPattern("sl2")', '"010"'); |
| 91 | 91 |
| 92 mouseDownOnSelect("sl2", 3); | 92 mouseDownOnSelect("sl2", 3); |
| 93 shouldBe('selectionPattern("sl2")', '"010"'); | 93 shouldBe('selectionPattern("sl2")', '"010"'); |
| 94 | 94 |
| 95 mouseDownOnSelect("sl2", 2); | 95 mouseDownOnSelect("sl2", 2); |
| 96 shouldBe('selectionPattern("sl2")', '"001"'); | 96 shouldBe('selectionPattern("sl2")', '"001"'); |
| 97 </script> | 97 </script> |
| 98 </body> | 98 </body> |
| 99 </html> | 99 </html> |
| OLD | NEW |