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

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

Issue 2867103005: Merge to M59: Revert "Fix computation of Automation API location offsets in WebViews." (Closed)
Patch Set: Created 3 years, 7 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 ac63b587200da51c7eb7187475f83a3ad1d79e24..14070e3ade43250b8fb7d1dcd10d163e292d13d2 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.cc
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.cc
@@ -553,6 +553,7 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
gfx::RectF local_bounds = ComputeLocalNodeBounds(cache, node);
gfx::Rect global_bounds =
ComputeGlobalNodeBounds(cache, node, local_bounds);
+ global_bounds.Offset(cache->location_offset);
result.Set(RectToV8Object(isolate, global_bounds));
});
RouteNodeIDFunction(
@@ -592,6 +593,7 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
if (node->data().role != ui::AX_ROLE_INLINE_TEXT_BOX) {
gfx::Rect global_bounds =
ComputeGlobalNodeBounds(cache, node, local_bounds);
+ global_bounds.Offset(cache->location_offset);
result.Set(RectToV8Object(isolate, global_bounds));
}
@@ -633,6 +635,7 @@ AutomationInternalCustomBindings::AutomationInternalCustomBindings(
// transformations.
gfx::Rect global_bounds =
ComputeGlobalNodeBounds(cache, node, local_bounds);
+ global_bounds.Offset(cache->location_offset);
result.Set(RectToV8Object(isolate, global_bounds));
});
@@ -1029,12 +1032,8 @@ ui::AXNode* AutomationInternalCustomBindings::GetParent(
return node->parent();
int parent_tree_id = (*in_out_cache)->tree.data().parent_tree_id;
-
- // Try the desktop tree if the parent is unknown. If this tree really is
- // a child of the desktop tree, we'll find its parent, and if not, the
- // search, below, will fail until the real parent tree loads.
if (parent_tree_id < 0)
- parent_tree_id = api::automation::kDesktopTreeID;
+ return nullptr;
TreeCache* parent_cache = GetTreeCacheFromTreeID(parent_tree_id);
if (!parent_cache)
@@ -1042,9 +1041,9 @@ ui::AXNode* AutomationInternalCustomBindings::GetParent(
// Try to use the cached parent node from the most recent time this
// was called.
- if ((*in_out_cache)->parent_node_id_from_parent_tree > 0) {
+ if (parent_cache->parent_node_id_from_parent_tree > 0) {
ui::AXNode* parent = parent_cache->tree.GetFromId(
- (*in_out_cache)->parent_node_id_from_parent_tree);
+ parent_cache->parent_node_id_from_parent_tree);
if (parent) {
int parent_child_tree_id =
parent->data().GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID);
@@ -1152,6 +1151,7 @@ void AutomationInternalCustomBindings::OnAccessibilityEvent(
}
// Update the internal state whether it's the active profile or not.
+ cache->location_offset = params.location_offset;
deleted_node_ids_.clear();
if (!cache->tree.Unserialize(params.update)) {
LOG(ERROR) << cache->tree.error();

Powered by Google App Engine
This is Rietveld 408576698