| 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 /** | 5 // Installs suggestion management functions on the |__gCrWeb| object. |
| 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 */ | |
| 12 | 6 |
| 13 /* Beginning of anonymous object. */ | 7 /* Beginning of anonymous object. */ |
| 14 (function() { | 8 (function() { |
| 15 | 9 |
| 16 /** | 10 /** |
| 17 * Namespace for this file. It depends on |__gCrWeb| having already been | 11 * Namespace for this file. It depends on |__gCrWeb| having already been |
| 18 * injected. | 12 * injected. |
| 19 */ | 13 */ |
| 20 __gCrWeb.suggestion = {}; | 14 __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; | |
| 26 | 15 |
| 27 /** | 16 /** |
| 28 * Returns the first element in |elements| that is later than |elementToCompare| | 17 * Returns the first element in |elements| that is later than |elementToCompare| |
| 29 * in tab order. | 18 * in tab order. |
| 30 * | 19 * |
| 31 * @param {Element} elementToCompare The element to start searching forward in | 20 * @param {Element} elementToCompare The element to start searching forward in |
| 32 * tab order from. | 21 * tab order from. |
| 33 * @param {NodeList} elementList Elements in which the first element that is | 22 * @param {NodeList} elementList Elements in which the first element that is |
| 34 * later than |elementToCompare| in tab order is to be returned if there is | 23 * later than |elementToCompare| in tab order is to be returned if there is |
| 35 * one; |elements| should be sorted in DOM tree order and should contain | 24 * 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... |
| 322 */ | 311 */ |
| 323 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { | 312 __gCrWeb.suggestion['hasPreviousElement'] = function(formName, fieldName) { |
| 324 var currentElement = | 313 var currentElement = |
| 325 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : | 314 formName ? __gCrWeb.suggestion.getFormElement(formName, fieldName) : |
| 326 document.activeElement; | 315 document.activeElement; |
| 327 return __gCrWeb.suggestion.getPreviousElementInTabOrder( | 316 return __gCrWeb.suggestion.getPreviousElementInTabOrder( |
| 328 currentElement, document.all) !== null; | 317 currentElement, document.all) !== null; |
| 329 }; | 318 }; |
| 330 | 319 |
| 331 }()); // End of anonymous object | 320 }()); // End of anonymous object |
| OLD | NEW |