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

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

Issue 2301833005: Get rid of AX_LINE_BREAKS attribute to improve performance. (Closed)
Patch Set: Re-worded comment. Created 4 years, 3 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 b19a3385a05ac605355e518630dc644d872c0e79..e85958a5b6500275d07264a91e9d9cf21799e6ca 100644
--- a/chrome/renderer/resources/extensions/automation/automation_node.js
+++ b/chrome/renderer/resources/extensions/automation/automation_node.js
@@ -150,6 +150,16 @@ var GetBoundsForRange = requireNative('automationInternal').GetBoundsForRange;
/**
* @param {number} axTreeID The id of the accessibility tree.
* @param {number} nodeID The id of a node.
+ * @return {!Array.<number>} The text offset where each line starts, or an empty
+ * array if this node has no text content, or undefined if the tree or node
+ * was not found.
+ */
+var GetLineStartOffsets = requireNative(
+ 'automationInternal').GetLineStartOffsets;
+
+/**
+ * @param {number} axTreeID The id of the accessibility tree.
+ * @param {number} nodeID The id of a node.
* @param {string} attr The name of a string attribute.
* @return {?string} The value of this attribute, or undefined if the tree,
* node, or attribute wasn't found.
@@ -267,6 +277,10 @@ AutomationNodeImpl.prototype = {
return GetIndexInParent(this.treeID, this.id);
},
+ get lineStartOffsets() {
+ return GetLineStartOffsets(this.treeID, this.id);
+ },
+
get childTree() {
var childTreeID = GetIntAttribute(this.treeID, this.id, 'childTreeId');
if (childTreeID)
@@ -687,7 +701,6 @@ var nodeRefAttributes = [
var intListAttributes = [
'characterOffsets',
- 'lineBreaks',
'markerEnds',
'markerStarts',
'markerTypes',
@@ -1037,6 +1050,7 @@ utils.expose(AutomationNode, AutomationNodeImpl, {
'state',
'location',
'indexInParent',
+ 'lineStartOffsets',
'root',
'htmlAttributes',
]),

Powered by Google App Engine
This is Rietveld 408576698