OLD | NEW |
1 function $(id) { | 1 function $(id) { |
2 return document.getElementById(id); | 2 return document.getElementById(id); |
3 } | 3 } |
4 | 4 |
5 function getValidationMessageBubbleNode(host) { | 5 function getValidationMessageBubbleNode(host) { |
6 // FIXME: We should search for a pseudo ID. | 6 // FIXME: We should search for a pseudo ID. |
7 return internals.shadowRoot(host).lastChild; | 7 return internals.shadowRoot(host).lastChild; |
8 } | 8 } |
9 | 9 |
10 function getAbsoluteRect(element) { | 10 function getAbsoluteRect(element) { |
11 var rect = element.getBoundingClientRect(); | 11 var rect = element.getBoundingClientRect(); |
12 rect.top += document.body.scrollTop; | 12 rect.top += document.body.scrollTop; |
13 rect.bottom += document.body.scrollTop; | 13 rect.bottom += document.body.scrollTop; |
14 rect.left += document.body.scrollLeft; | 14 rect.left += document.body.scrollLeft; |
15 rect.right += document.body.scrollLeft; | 15 rect.right += document.body.scrollLeft; |
16 return rect; | 16 return rect; |
17 } | 17 } |
18 | 18 |
19 function searchCancelButtonPosition(element) { | 19 function searchCancelButtonPosition(element) { |
20 var pos = {}; | 20 var pos = {}; |
21 pos.x = element.offsetLeft + element.offsetWidth - 9; | 21 pos.x = element.offsetLeft + element.offsetWidth - 9; |
22 pos.y = element.offsetTop + element.offsetHeight / 2; | 22 pos.y = element.offsetTop + element.offsetHeight / 2; |
23 return pos; | 23 return pos; |
24 } | 24 } |
| 25 |
| 26 function mouseMoveToIndexInListbox(index, listboxId) { |
| 27 var listbox = document.getElementById(listboxId); |
| 28 var itemHeight = Math.floor(listbox.offsetHeight / listbox.size); |
| 29 var border = 1; |
| 30 var y = border + index * itemHeight; |
| 31 if (window.eventSender) |
| 32 eventSender.mouseMoveTo(listbox.offsetLeft + border, listbox.offsetTop +
y - window.pageYOffset); |
| 33 } |
OLD | NEW |