| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| index 1d12d9d05e93e447ea9745c8c5449f9a51b542ef..f6171c26a7697d1e77514d44ec8bc759f56d12ec 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
|
| @@ -30,6 +30,7 @@ var AutomationNode = chrome.automation.AutomationNode;
|
| var Dir = constants.Dir;
|
| var EventType = chrome.automation.EventType;
|
| var RoleType = chrome.automation.RoleType;
|
| +var StateType = chrome.automation.StateType;
|
|
|
| /**
|
| * An Output object formats a cursors.Range into speech, braille, or both
|
| @@ -985,7 +986,7 @@ Output.prototype = {
|
| return;
|
| var uniqueAncestors = AutomationUtil.getUniqueAncestors(prevParent, parent);
|
| for (var i = 0; parent = uniqueAncestors[i]; i++) {
|
| - if (parent.role == RoleType.window)
|
| + if (parent.role == RoleType.WINDOW)
|
| break;
|
| if (Output.ROLE_INFO_[parent.role] &&
|
| Output.ROLE_INFO_[parent.role].outputContextFirst) {
|
| @@ -1052,7 +1053,7 @@ Output.prototype = {
|
| if (prefix == '$') {
|
| if (token == 'value') {
|
| var text = node.value;
|
| - if (!node.state.editable && node.name == text)
|
| + if (!node.state[StateType.EDITABLE] && node.name == text)
|
| return;
|
|
|
| var selectedText = '';
|
| @@ -1144,8 +1145,8 @@ Output.prototype = {
|
| msg = 'aria_checked_false';
|
| break;
|
| default:
|
| - msg =
|
| - node.state.checked ? 'aria_checked_true' : 'aria_checked_false';
|
| + msg = node.state[StateType.CHECKED] ?
|
| + 'aria_checked_true' : 'aria_checked_false';
|
| }
|
| this.format_(node, '@' + msg, buff);
|
| } else if (token == 'state') {
|
| @@ -1159,7 +1160,8 @@ Output.prototype = {
|
| if (tree.firstChild) {
|
| var jsonQuery = tree.firstChild.value;
|
| node = node.find(
|
| - /** @type {Object}*/(JSON.parse(jsonQuery)));
|
| + /** @type {chrome.automation.FindParams}*/(
|
| + JSON.parse(jsonQuery)));
|
| var formatString = tree.firstChild.nextSibling;
|
| if (node)
|
| this.format_(node, formatString, buff);
|
| @@ -1450,7 +1452,7 @@ Output.prototype = {
|
| for (i = 0; i < ancestors.length - 1; i++) {
|
| var node = ancestors[i];
|
| // Discard ancestors of deepest window.
|
| - if (node.role == RoleType.window) {
|
| + if (node.role == RoleType.WINDOW) {
|
| contextFirst = [];
|
| rest = [];
|
| }
|
| @@ -1614,7 +1616,7 @@ Output.prototype = {
|
| options.annotation.push(earcon);
|
| var text = '';
|
|
|
| - if (this.formatOptions_.braille && !node.state.editable) {
|
| + if (this.formatOptions_.braille && !node.state[StateType.EDITABLE]) {
|
| // In braille, we almost always want to show the entire contents and
|
| // simply place the cursor under the SelectionSpan we set above.
|
| text = range.start.getText();
|
| @@ -1757,7 +1759,7 @@ Output.prototype = {
|
| if (!s.node)
|
| return false;
|
| return s.node.display == 'inline' ||
|
| - s.node.role == RoleType.inlineTextBox;
|
| + s.node.role == RoleType.INLINE_TEXT_BOX;
|
| });
|
|
|
| var isName = cur.hasSpan('name');
|
|
|