OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Installs suggestion management functions on the |__gCrWeb| object. | 5 // Installs suggestion management functions on the |__gCrWeb| object. |
6 | 6 |
| 7 /* Beginning of anonymous object. */ |
| 8 (function() { |
| 9 |
7 /** | 10 /** |
8 * Namespace for this file. It depends on |__gCrWeb| having already been | 11 * Namespace for this file. It depends on |__gCrWeb| having already been |
9 * injected. | 12 * injected. |
10 */ | 13 */ |
11 __gCrWeb['suggestion'] = {}; | 14 __gCrWeb['suggestion'] = {}; |
12 | 15 |
13 /** | 16 /** |
14 * Returns the first element in |elements| that is later than |elementToCompare| | 17 * Returns the first element in |elements| that is later than |elementToCompare| |
15 * in tab order. | 18 * in tab order. |
16 * | 19 * |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 * @return {boolean} Whether there is an element in the sequential navigation | 309 * @return {boolean} Whether there is an element in the sequential navigation |
307 * before the currently active element. | 310 * before the currently active element. |
308 */ | 311 */ |
309 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { | 312 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { |
310 var currentElement = | 313 var currentElement = |
311 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : | 314 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : |
312 document.activeElement; | 315 document.activeElement; |
313 return __gCrWeb.suggestion.getPreviousElementInTabOrder( | 316 return __gCrWeb.suggestion.getPreviousElementInTabOrder( |
314 currentElement, document.all) !== null; | 317 currentElement, document.all) !== null; |
315 }; | 318 }; |
| 319 |
| 320 }()); // End of anonymous object |
OLD | NEW |