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

Side by Side Diff: ui/accessibility/ax_tree_combiner.cc

Issue 2217363002: Use relative bounding boxes throughout Chrome accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback from aboxhall Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « ui/accessibility/ax_relative_bounds.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 #include "ui/accessibility/ax_tree_combiner.h" 6 #include "ui/accessibility/ax_tree_combiner.h"
7 #include "ui/gfx/geometry/rect_f.h" 7 #include "ui/gfx/geometry/rect_f.h"
8 8
9 namespace ui { 9 namespace ui {
10 namespace { 10 namespace {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 AXNodeData node = tree->nodes[i]; 178 AXNodeData node = tree->nodes[i];
179 int32_t child_tree_id = node.GetIntAttribute(AX_ATTR_CHILD_TREE_ID); 179 int32_t child_tree_id = node.GetIntAttribute(AX_ATTR_CHILD_TREE_ID);
180 180
181 // Map the node's ID. 181 // Map the node's ID.
182 node.id = MapId(tree_id, node.id); 182 node.id = MapId(tree_id, node.id);
183 183
184 // Map the node's child IDs. 184 // Map the node's child IDs.
185 for (size_t j = 0; j < node.child_ids.size(); ++j) 185 for (size_t j = 0; j < node.child_ids.size(); ++j)
186 node.child_ids[j] = MapId(tree_id, node.child_ids[j]); 186 node.child_ids[j] = MapId(tree_id, node.child_ids[j]);
187 187
188 // Reset the offset container ID because we make all bounding boxes
189 // absolute.
190 node.offset_container_id = -1;
191
188 // Map other int attributes that refer to node IDs, and remove the 192 // Map other int attributes that refer to node IDs, and remove the
189 // AX_ATTR_CHILD_TREE_ID attribute. 193 // AX_ATTR_CHILD_TREE_ID attribute.
190 for (size_t j = 0; j < node.int_attributes.size(); ++j) { 194 for (size_t j = 0; j < node.int_attributes.size(); ++j) {
191 auto& attr = node.int_attributes[j]; 195 auto& attr = node.int_attributes[j];
192 if (IsNodeIdIntAttribute(attr.first)) 196 if (IsNodeIdIntAttribute(attr.first))
193 attr.second = MapId(tree_id, attr.second); 197 attr.second = MapId(tree_id, attr.second);
194 if (attr.first == AX_ATTR_CHILD_TREE_ID) { 198 if (attr.first == AX_ATTR_CHILD_TREE_ID) {
195 attr.first = AX_INT_ATTRIBUTE_NONE; 199 attr.first = AX_INT_ATTRIBUTE_NONE;
196 attr.second = 0; 200 attr.second = 0;
197 } 201 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Recurse into the child tree now, if any. 235 // Recurse into the child tree now, if any.
232 if (child_tree) 236 if (child_tree)
233 ProcessTree(child_tree); 237 ProcessTree(child_tree);
234 } 238 }
235 239
236 // Reset the transform. 240 // Reset the transform.
237 transform_ = old_transform; 241 transform_ = old_transform;
238 } 242 }
239 243
240 } // namespace ui 244 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_relative_bounds.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698