Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/aria_util.js

Issue 1774743002: Fix some ChromeVox Closure compiler errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /**
6 * @fileoverview A collection of JavaScript utilities used to simplify working 6 * @fileoverview A collection of JavaScript utilities used to simplify working
7 * with ARIA (http://www.w3.org/TR/wai-aria). 7 * with ARIA (http://www.w3.org/TR/wai-aria).
8 */ 8 */
9 9
10 10
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 result = result.concat(nextLevel); 586 result = result.concat(nextLevel);
587 } 587 }
588 } 588 }
589 return result; 589 return result;
590 }; 590 };
591 591
592 592
593 /** 593 /**
594 * Recursively finds the first node(s) that match the role. 594 * Recursively finds the first node(s) that match the role.
595 * 595 *
596 * @param {Element} current The node to start looking at. 596 * @param {Node} current The node to start looking at.
597 * @param {Array<string>} role The role(s) to match. 597 * @param {Array<string>} role The role(s) to match.
598 * @return {Array<Element>} The array of matching nodes. 598 * @return {Array<Element>} The array of matching nodes.
599 */ 599 */
600 cvox.AriaUtil.getNextLevelItems = function(current, role) { 600 cvox.AriaUtil.getNextLevelItems = function(current, role) {
601 if (current.nodeType != 1) { // If reached a node that is not an element. 601 if (current.nodeType != 1) { // If reached a node that is not an element.
602 return []; 602 return [];
603 } 603 }
604 if (role.indexOf(cvox.AriaUtil.getRoleAttribute(current)) != -1) { 604 if (role.indexOf(cvox.AriaUtil.getRoleAttribute(current)) != -1) {
605 return [current]; 605 return [current];
606 } else { 606 } else {
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 * @param {Node} node The node to be checked. 965 * @param {Node} node The node to be checked.
966 * @return {boolean} Whether or not the node is an ARIA math node. 966 * @return {boolean} Whether or not the node is an ARIA math node.
967 */ 967 */
968 cvox.AriaUtil.isMath = function(node) { 968 cvox.AriaUtil.isMath = function(node) {
969 if (!node || !node.getAttribute) { 969 if (!node || !node.getAttribute) {
970 return false; 970 return false;
971 } 971 }
972 var role = cvox.AriaUtil.getRoleAttribute(node); 972 var role = cvox.AriaUtil.getRoleAttribute(node);
973 return role == 'math'; 973 return role == 'math';
974 }; 974 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698