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

Unified Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 2059533003: Expose html attributes in automation tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/resources/extensions/automation/automation_node.js
diff --git a/chrome/renderer/resources/extensions/automation/automation_node.js b/chrome/renderer/resources/extensions/automation/automation_node.js
index 683bd9b5234a8d0ea2ee7fadba9b3637da168614..357f192146963438d3dcb199b4fe57ff25cb7bac 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -92,6 +92,13 @@ var GetChildIDAtIndex = requireNative('automationInternal').GetChildIDAtIndex;
/**
* @param {number} axTreeID The id of the accessibility tree.
* @param {number} nodeID The id of a node.
+ * @return {?Object} An object mapping html attributes to values.
+ */
+var GetHtmlAttributes = requireNative('automationInternal').GetHtmlAttributes;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @param {number} nodeID The id of a node.
* @return {?number} The index of this node in its parent, or undefined if
* the tree or node or node parent wasn't found.
*/
@@ -228,6 +235,10 @@ AutomationNodeImpl.prototype = {
return this.rootImpl.get(parentID);
},
+ get htmlAttributes() {
+ return GetHtmlAttributes(this.treeID, this.id) || {};
+ },
+
get state() {
return GetState(this.treeID, this.id) || {};
},
@@ -1011,6 +1022,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, {
'location',
'indexInParent',
'root',
+ 'htmlAttributes',
]),
});

Powered by Google App Engine
This is Rietveld 408576698