OLD | NEW |
1 function $(id) { | 1 function $(id) { |
2 return document.getElementById(id); | 2 return document.getElementById(id); |
3 } | 3 } |
4 | 4 |
5 function createFormControlDataSet() { | 5 function createFormControlDataSet() { |
6 // A list of labelable elements resides in http://www.whatwg.org/specs/web-a
pps/current-work/multipage/forms.html#category-label | 6 // A list of labelable elements resides in http://www.whatwg.org/specs/web-a
pps/current-work/multipage/forms.html#category-label |
7 var formControlClassNames = [ | 7 var formControlClassNames = [ |
8 'HTMLButtonElement', | 8 'HTMLButtonElement', |
9 'HTMLDataListElement', | 9 'HTMLDataListElement', |
10 'HTMLFieldSetElement', | 10 'HTMLFieldSetElement', |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 tagName: 'input', | 81 tagName: 'input', |
82 }; | 82 }; |
83 } | 83 } |
84 formControlDataSet.hiddenType.isLabelable = false; | 84 formControlDataSet.hiddenType.isLabelable = false; |
85 | 85 |
86 return formControlDataSet; | 86 return formControlDataSet; |
87 } | 87 } |
88 | 88 |
89 function getAbsoluteRect(element) { | 89 function getAbsoluteRect(element) { |
90 var rect = element.getBoundingClientRect(); | 90 var rect = element.getBoundingClientRect(); |
91 rect.top += document.body.scrollTop; | 91 rect.top += document.scrollingElement.scrollTop; |
92 rect.bottom += document.body.scrollTop; | 92 rect.bottom += document.scrollingElement.scrollTop; |
93 rect.left += document.body.scrollLeft; | 93 rect.left += document.scrollingElement.scrollLeft; |
94 rect.right += document.body.scrollLeft; | 94 rect.right += document.scrollingElement.scrollLeft; |
95 return rect; | 95 return rect; |
96 } | 96 } |
97 | 97 |
98 function searchCancelButtonPosition(element) { | 98 function searchCancelButtonPosition(element) { |
99 var pos = {}; | 99 var pos = {}; |
100 pos.x = element.offsetLeft + element.offsetWidth - 9; | 100 pos.x = element.offsetLeft + element.offsetWidth - 9; |
101 pos.y = element.offsetTop + element.offsetHeight / 2; | 101 pos.y = element.offsetTop + element.offsetHeight / 2; |
102 return pos; | 102 return pos; |
103 } | 103 } |
104 | 104 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 document.addEventListener('focusin', function() { | 208 document.addEventListener('focusin', function() { |
209 if (internals.hasAutofocusRequest(document)) | 209 if (internals.hasAutofocusRequest(document)) |
210 return; | 210 return; |
211 if (autofocused) | 211 if (autofocused) |
212 return; | 212 return; |
213 autofocused = true; | 213 autofocused = true; |
214 if (loaded) | 214 if (loaded) |
215 callback(); | 215 callback(); |
216 }, false); | 216 }, false); |
217 } | 217 } |
OLD | NEW |