Commit 8b79607f authored by aboxhall's avatar aboxhall Committed by Commit bot

Remove attributes and methods which should not be part of the public API

BUG=309681

Review URL: https://codereview.chromium.org/514363002

Cr-Commit-Position: refs/heads/master@{#292835}
parent 95af6d45
......@@ -197,7 +197,7 @@ AutomationNodeImpl.prototype = {
// Not yet initialized.
if (this.rootImpl.processID === undefined ||
this.rootImpl.routingID === undefined ||
this.wrapper.id === undefined) {
this.id === undefined) {
return;
}
......@@ -209,7 +209,7 @@ AutomationNodeImpl.prototype = {
automationInternal.performAction({ processID: this.rootImpl.processID,
routingID: this.rootImpl.routingID,
automationNodeID: this.wrapper.id,
automationNodeID: this.id,
actionType: actionType },
opt_args || {});
}
......@@ -329,8 +329,9 @@ AutomationRootNodeImpl.prototype = {
var children = nodeToClear.children();
for (var i = 0; i < children.length; i++)
this.invalidate_(children[i]);
privates(nodeToClear).impl.childIds = []
updateState.pendingNodes[nodeToClear.id] = nodeToClear;
var nodeToClearImpl = privates(nodeToClear).impl;
nodeToClearImpl.childIds = []
updateState.pendingNodes[nodeToClearImpl.id] = nodeToClear;
}
}
......@@ -402,7 +403,7 @@ AutomationRootNodeImpl.prototype = {
// This object is not accessible outside of bindings code, but we can access
// it here.
var nodeImpl = privates(node).impl;
var id = node.id;
var id = nodeImpl.id;
for (var key in AutomationAttributeDefaults) {
nodeImpl[key] = AutomationAttributeDefaults[key];
}
......@@ -427,8 +428,8 @@ AutomationRootNodeImpl.prototype = {
for (var i = 0; i < newChildIds.length; i++) {
var childId = newChildIds[i];
if (newChildIdSet[childId]) {
logging.WARNING('Node ' + node.id + ' has duplicate child id ' +
childId);
logging.WARNING('Node ' + privates(node).impl.id +
' has duplicate child id ' + childId);
lastError.set('automation',
'Bad update received on automation tree',
null,
......@@ -463,13 +464,16 @@ AutomationRootNodeImpl.prototype = {
var childNode = this.axNodeDataCache_[childId];
if (childNode) {
if (childNode.parent() != node) {
var parentId = 0;
if (childNode.parent()) parentId = childNode.parent().id;
var parentId = -1;
if (childNode.parent()) {
var parentImpl = privates(childNode.parent()).impl;
parentId = parentImpl.id;
}
// This is a serious error - nodes should never be reparented.
// If this case occurs, continue so this node isn't left in an
// inconsistent state, but return failure at the end.
logging.WARNING('Node ' + childId + ' reparented from ' +
parentId + ' to ' + node.id);
parentId + ' to ' + privates(node).impl.id);
lastError.set('automation',
'Bad update received on automation tree',
null,
......@@ -481,11 +485,11 @@ AutomationRootNodeImpl.prototype = {
childNode = new AutomationNode(this);
this.axNodeDataCache_[childId] = childNode;
privates(childNode).impl.id = childId;
updateState.pendingNodes[childNode.id] = childNode;
updateState.newNodes[childNode.id] = childNode;
updateState.pendingNodes[childId] = childNode;
updateState.newNodes[childId] = childNode;
}
privates(childNode).impl.indexInParent = i;
privates(childNode).impl.parentID = node.id;
privates(childNode).impl.parentID = privates(node).impl.id;
}
return success;
......@@ -548,7 +552,7 @@ AutomationRootNodeImpl.prototype = {
var node = this.axNodeDataCache_[nodeData.id];
var didUpdateRoot = false;
if (node) {
delete updateState.pendingNodes[node.id];
delete updateState.pendingNodes[privates(node).impl.id];
} else {
if (nodeData.role != schema.RoleType.rootWebArea &&
nodeData.role != schema.RoleType.desktop) {
......@@ -582,7 +586,7 @@ AutomationRootNodeImpl.prototype = {
nodeData.childIds,
updateState);
nodeImpl.childIds = nodeData.childIds;
this.axNodeDataCache_[node.id] = node;
this.axNodeDataCache_[nodeImpl.id] = node;
return success;
}
......@@ -602,16 +606,13 @@ var AutomationNode = utils.expose('AutomationNode',
'makeVisible',
'setSelection',
'addEventListener',
'removeEventListener',
'toString'],
'removeEventListener'],
readonly: ['isRootNode',
'id',
'role',
'state',
'location',
'attributes',
'root',
'toString'] });
'root'] });
var AutomationRootNode = utils.expose('AutomationRootNode',
AutomationRootNodeImpl,
......
......@@ -45,37 +45,38 @@ var tests = [
{
'id': 5, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-activedescendant': 'target'},
'htmlAttributes': {'aria-activedescendant': 'target',
'id': 'activedescendant'},
'intAttributes': {'activedescendantId': 11},
},
{
'id': 6, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-controls': 'target'},
'htmlAttributes': {'aria-controls': 'target', 'id': 'controlledBy'},
'intlistAttributes': {'controlsIds': [11]},
},
{
'id': 7, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-describedby': 'target'},
'htmlAttributes': {'aria-describedby': 'target', 'id': 'describedBy'},
'intlistAttributes': {'describedbyIds': [11, 6]},
},
{
'id': 8, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-flowto': 'target'},
'htmlAttributes': {'aria-flowto': 'target', 'id': 'flowTo'},
'intlistAttributes': {'flowtoIds': [11]},
},
{
'id': 9, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-labelledby': 'target'},
'htmlAttributes': {'aria-labelledby': 'target', 'id': 'labelledBy'},
'intlistAttributes': {'labelledbyIds': [11]}
},
{
'id': 10, 'role': 'div',
'childIds': [],
'htmlAttributes': {'aria-owns': 'target'},
'htmlAttributes': {'aria-owns': 'target', 'id': 'owns'},
'intlistAttributes': {'ownsIds': [11]},
}
]}
......@@ -86,43 +87,50 @@ var tests = [
var activedescendant = tree.firstChild();
assertIsDef(activedescendant);
assertEq(5, activedescendant.id);
assertEq(11, activedescendant.attributes['aria-activedescendant'].id);
assertEq('activedescendant', activedescendant.attributes.id);
assertEq(
'target',
activedescendant.attributes['aria-activedescendant'].attributes.id);
assertIsNotDef(activedescendant.attributes.activedescendantId);
var controlledBy = activedescendant.nextSibling();
assertIsDef(controlledBy);
assertEq(6, controlledBy.id);
assertEq(11, controlledBy.attributes['aria-controls'][0].id);
assertEq('controlledBy', controlledBy.attributes.id);
assertEq('target',
controlledBy.attributes['aria-controls'][0].attributes.id);
assertEq(1, controlledBy.attributes['aria-controls'].length);
assertIsNotDef(controlledBy.attributes.controlledbyIds);
var describedBy = controlledBy.nextSibling();
assertIsDef(describedBy);
assertEq(7, describedBy.id);
assertEq(11, describedBy.attributes['aria-describedby'][0].id);
assertEq(6, describedBy.attributes['aria-describedby'][1].id);
assertEq('describedBy', describedBy.attributes.id);
assertEq('target',
describedBy.attributes['aria-describedby'][0].attributes.id);
assertEq('controlledBy',
describedBy.attributes['aria-describedby'][1].attributes.id);
assertEq(2, describedBy.attributes['aria-describedby'].length);
assertIsNotDef(describedBy.attributes.describedbyIds);
var flowTo = describedBy.nextSibling();
assertIsDef(flowTo);
assertEq(8, flowTo.id);
assertEq(11, flowTo.attributes['aria-flowto'][0].id);
assertEq('flowTo', flowTo.attributes.id);
assertEq('target',
flowTo.attributes['aria-flowto'][0].attributes.id);
assertEq(1, flowTo.attributes['aria-flowto'].length);
assertIsNotDef(flowTo.attributes.flowtoIds);
var labelledBy = flowTo.nextSibling();
assertIsDef(labelledBy);
assertEq(9, labelledBy.id);
assertEq(11, labelledBy.attributes['aria-labelledby'][0].id);
assertEq('labelledBy', labelledBy.attributes.id);
assertEq('target',
labelledBy.attributes['aria-labelledby'][0].attributes.id);
assertEq(1, labelledBy.attributes['aria-labelledby'].length);
assertIsNotDef(labelledBy.attributes.labelledbyIds);
var owns = labelledBy.nextSibling();
assertIsDef(owns);
assertEq(10, owns.id);
assertEq(11, owns.attributes['aria-owns'][0].id);
assertEq('owns', owns.attributes.id);
assertEq('target', owns.attributes['aria-owns'][0].attributes.id);
assertEq(1, owns.attributes['aria-owns'].length);
assertIsNotDef(owns.attributes.ownsIds);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment