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

Unified Diff: chrome/renderer/extensions/automation_internal_custom_bindings.cc

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/extensions/automation_internal_custom_bindings.cc
diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.cc b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
index c78f0d1382acbc51a6e91645626baad9c15c5739..5c8dc7fa754e26d1226a369c9dd12fb42a777e3c 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -527,6 +527,20 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
location.Offset(cache->location_offset);
result.Set(RectToV8Object(isolate, location));
});
+ RouteNodeIDFunction(
+ "GetLineStartOffsets",
+ [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
+ TreeCache* cache, ui::AXNode* node) {
+ const std::vector<int> line_starts =
+ node->GetOrComputeLineStartOffsets();
+ v8::Local<v8::Array> array_result(
+ v8::Array::New(isolate, line_starts.size()));
+ for (size_t i = 0; i < line_starts.size(); ++i) {
+ array_result->Set(static_cast<uint32_t>(i),
+ v8::Integer::New(isolate, line_starts[i]));
+ }
+ result.Set(array_result);
+ });
RouteNodeIDFunction("GetChildIDs", [](v8::Isolate* isolate,
v8::ReturnValue<v8::Value> result,
TreeCache* cache, ui::AXNode* node) {

Powered by Google App Engine
This is Rietveld 408576698