| 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 /** |
| 6 * @fileoverview Installs suggestion management functions on the |
| 7 * __gCrWeb object. |
| 8 * |
| 9 * TODO(crbug.com/647084): Enable checkTypes error for this file. |
| 10 * @suppress {checkTypes} |
| 11 */ |
| 6 | 12 |
| 7 /* Beginning of anonymous object. */ | 13 /* Beginning of anonymous object. */ |
| 8 (function() { | 14 (function() { |
| 9 | 15 |
| 10 /** | 16 /** |
| 11 * Namespace for this file. It depends on |__gCrWeb| having already been | 17 * Namespace for this file. It depends on |__gCrWeb| having already been |
| 12 * injected. | 18 * injected. |
| 13 */ | 19 */ |
| 14 __gCrWeb['suggestion'] = {}; | 20 __gCrWeb.suggestion = {}; |
| 21 |
| 22 // Store suggestion namespace object in a global __gCrWeb object referenced by a |
| 23 // string, so it does not get renamed by closure compiler during the |
| 24 // minification. |
| 25 __gCrWeb['suggestion'] = __gCrWeb.suggestion; |
| 15 | 26 |
| 16 /** | 27 /** |
| 17 * Returns the first element in |elements| that is later than |elementToCompare| | 28 * Returns the first element in |elements| that is later than |elementToCompare| |
| 18 * in tab order. | 29 * in tab order. |
| 19 * | 30 * |
| 20 * @param {Element} elementToCompare The element to start searching forward in | 31 * @param {Element} elementToCompare The element to start searching forward in |
| 21 * tab order from. | 32 * tab order from. |
| 22 * @param {NodeList} elementList Elements in which the first element that is | 33 * @param {NodeList} elementList Elements in which the first element that is |
| 23 * later than |elementToCompare| in tab order is to be returned if there is | 34 * later than |elementToCompare| in tab order is to be returned if there is |
| 24 * one; |elements| should be sorted in DOM tree order and should contain | 35 * one; |elements| should be sorted in DOM tree order and should contain |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 */ | 322 */ |
| 312 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { | 323 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { |
| 313 var currentElement = | 324 var currentElement = |
| 314 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : | 325 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : |
| 315 document.activeElement; | 326 document.activeElement; |
| 316 return __gCrWeb.suggestion.getPreviousElementInTabOrder( | 327 return __gCrWeb.suggestion.getPreviousElementInTabOrder( |
| 317 currentElement, document.all) !== null; | 328 currentElement, document.all) !== null; |
| 318 }; | 329 }; |
| 319 | 330 |
| 320 }()); // End of anonymous object | 331 }()); // End of anonymous object |
| OLD | NEW |