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

Unified Diff: ui/accessibility/ax_node.h

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: ui/accessibility/ax_node.h
diff --git a/ui/accessibility/ax_node.h b/ui/accessibility/ax_node.h
index e1415910c8275c7d09ea887fd9370d25b2c9c82b..7969ab3ed5f894aa962159e79bb14de92e483dd6 100644
--- a/ui/accessibility/ax_node.h
+++ b/ui/accessibility/ax_node.h
@@ -69,7 +69,16 @@ class AX_EXPORT AXNode {
// Return true if this object is equal to or a descendant of |ancestor|.
bool IsDescendantOf(AXNode* ancestor);
+ // Gets the text offsets where new lines start either from the node's data or
+ // by computing them and caching the result.
+ std::vector<int> GetOrComputeLineStartOffsets();
+
private:
+ // Computes the text offset where each line starts by traversing all child
+ // leaf nodes.
+ void ComputeLineStartOffsets(std::vector<int>* line_offsets,
+ int* end_offset) const;
+
int index_in_parent_;
AXNode* parent_;
std::vector<AXNode*> children_;

Powered by Google App Engine
This is Rietveld 408576698