Lines Matching refs:targetNode

1036       var targetNode = document.getElementById(targetId);
1037 if (targetNode &&
1038 cvox.DomUtil.isControl(targetNode) &&
1131 * @param {Node} targetNode The node to get ancestors for.
1132 * @return {Array.<Node>} An array of ancestors for the targetNode.
1134 cvox.DomUtil.getAncestors = function(targetNode) {
1136 while (targetNode) {
1137 ancestors.push(targetNode);
1138 targetNode = targetNode.parentNode;
1201 * @param {Node} targetNode The node to get the role name for.
1203 * @return {string} The role message identifier for the targetNode.
1205 cvox.DomUtil.getRoleMsg = function(targetNode, verbosity) {
1207 info = cvox.AriaUtil.getRoleNameMsg(targetNode);
1209 if (targetNode.tagName == 'INPUT') {
1210 info = cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG[targetNode.type];
1211 } else if (targetNode.tagName == 'A' &&
1212 cvox.DomUtil.isInternalLink(targetNode)) {
1214 } else if (targetNode.tagName == 'A' &&
1215 targetNode.getAttribute('name')) {
1217 } else if (targetNode.isContentEditable) {
1219 } else if (cvox.DomUtil.isMath(targetNode)) {
1221 } else if (targetNode.tagName == 'TABLE' &&
1222 cvox.DomUtil.isLayoutTable(targetNode)) {
1227 cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG[targetNode.tagName];
1230 targetNode.tagName];
1232 if (cvox.DomUtil.hasLongDesc(targetNode)) {
1236 if (!info && targetNode.onclick) {
1249 * targetNode's role is.
1253 * @param {Node} targetNode The node to get the role name for.
1255 * @return {string} The role name for the targetNode.
1257 cvox.DomUtil.getRole = function(targetNode, verbosity) {
1258 var roleMsg = cvox.DomUtil.getRoleMsg(targetNode, verbosity) || '';
1268 * @param {Node} targetNode The list node.
1271 cvox.DomUtil.getListLength = function(targetNode) {
1273 for (var node = targetNode.firstChild;
1293 * Returns a NodeState that gives information about the state of the targetNode.
1295 * @param {Node} targetNode The node to get the state information for.
1301 cvox.DomUtil.getStateMsgs = function(targetNode, primary) {
1302 var activeDescendant = cvox.AriaUtil.getActiveDescendant(targetNode);
1307 var role = targetNode.getAttribute ? targetNode.getAttribute('role') : '';
1308 info = cvox.AriaUtil.getStateMsgs(targetNode, primary);
1313 if (targetNode.tagName == 'INPUT') {
1314 if (!targetNode.hasAttribute('aria-checked')) {
1320 var msgId = INPUT_MSGS[targetNode.type + '-' + !!targetNode.checked];
1325 } else if (targetNode.tagName == 'SELECT') {
1326 if (targetNode.selectedOptions && targetNode.selectedOptions.length <= 1) {
1328 cvox.ChromeVox.msgs.getNumber(targetNode.selectedIndex + 1),
1329 cvox.ChromeVox.msgs.getNumber(targetNode.options.length)]);
1332 cvox.ChromeVox.msgs.getNumber(targetNode.selectedOptions.length)]);
1334 } else if (targetNode.tagName == 'UL' ||
1335 targetNode.tagName == 'OL' ||
1339 cvox.DomUtil.getListLength(targetNode))]);
1342 if (cvox.DomUtil.isDisabled(targetNode)) {
1346 if (cvox.DomPredicates.linkPredicate([targetNode]) &&
1347 cvox.ChromeVox.visitedUrls[targetNode.href]) {
1351 if (targetNode.accessKey) {
1352 info.push(['access_key', targetNode.accessKey]);
1360 * Returns a string that gives information about the state of the targetNode.
1362 * @param {Node} targetNode The node to get the state information for.
1368 cvox.DomUtil.getState = function(targetNode, primary) {
1370 cvox.DomUtil.getStateMsgs(targetNode, primary));
1384 * @param {Object} targetNode The node to check if it's focusable.
1387 cvox.DomUtil.isFocusable = function(targetNode) {
1388 if (!targetNode || typeof(targetNode.tabIndex) != 'number') {
1393 if ((targetNode.tagName == 'A') && !targetNode.hasAttribute('href') &&
1394 !targetNode.hasAttribute('tabindex')) {
1398 if (targetNode.tabIndex >= 0) {
1402 if (targetNode.hasAttribute &&
1403 targetNode.hasAttribute('tabindex') &&
1404 targetNode.getAttribute('tabindex') == '-1') {
1418 * @param {Node} targetNode The node whose descendants to check if focusable.
1422 cvox.DomUtil.findFocusableDescendant = function(targetNode) {
1424 if (targetNode) {
1426 cvox.DomUtil.findNode(targetNode, cvox.DomUtil.isFocusable);
1439 * @param {Node} targetNode The node whose descendants to check are focusable.
1442 cvox.DomUtil.countFocusableDescendants = function(targetNode) {
1443 return targetNode ?
1444 cvox.DomUtil.countNodes(targetNode, cvox.DomUtil.isFocusable) : 0;
1449 * Checks if the targetNode is still attached to the document.
1452 * @param {Object} targetNode The node to check.
1453 * @return {boolean} True if the targetNode is still attached.
1455 cvox.DomUtil.isAttachedToDocument = function(targetNode) {
1456 while (targetNode) {
1457 if (targetNode.tagName && (targetNode.tagName == 'HTML')) {
1460 targetNode = targetNode.parentNode;
1467 * Dispatches a left click event on the element that is the targetNode.
1469 * @param {Node} targetNode The target node of this operation.
1478 targetNode, shiftKey, callOnClickDirectly, opt_double,
1480 // If there is an activeDescendant of the targetNode, then that is where the
1482 var activeDescendant = cvox.AriaUtil.getActiveDescendant(targetNode);
1484 targetNode = activeDescendant;
1488 if (targetNode.onclick) {
1489 onClickFunction = targetNode.onclick;
1491 if (!onClickFunction && (targetNode.nodeType != 1) &&
1492 targetNode.parentNode && targetNode.parentNode.onclick) {
1493 onClickFunction = targetNode.parentNode.onclick;
1520 targetNode.dispatchEvent(evt);
1528 targetNode.dispatchEvent(evt);
1536 targetNode.dispatchEvent(evt);
1539 if (cvox.DomUtil.isInternalLink(targetNode)) {
1540 cvox.DomUtil.syncInternalLink(targetNode);
1550 var targetNode;
1552 targetNode = document.getElementById(targetId);
1553 if (!targetNode) {
1556 targetNode = nodes[0];
1559 if (targetNode) {
1561 var parent = targetNode.parentNode;
1564 parent.insertBefore(dummyNode, targetNode);
1567 cvox.ChromeVox.syncToNode(targetNode, false);
2291 * @param {Node} targetNode The target node to click on.
2292 * @return {function()} A function that will click on the given targetNode.
2294 cvox.DomUtil.createSimpleClickFunction = function(targetNode) {
2295 var target = targetNode.cloneNode(true);