| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 auto* container = GetFromId(node->data().offset_container_id); | 192 auto* container = GetFromId(node->data().offset_container_id); |
| 193 if (!container) { | 193 if (!container) { |
| 194 if (node == root()) | 194 if (node == root()) |
| 195 container = node->parent(); | 195 container = node->parent(); |
| 196 else | 196 else |
| 197 container = root(); | 197 container = root(); |
| 198 } | 198 } |
| 199 if (!container || container == node) | 199 if (!container || container == node) |
| 200 break; | 200 break; |
| 201 | 201 |
| 202 gfx::RectF container_bounds = container->data().location; | 202 const ui::AXNodeData& container_data = container->data(); |
| 203 gfx::RectF container_bounds = container_data.location; |
| 203 bounds.Offset(container_bounds.x(), container_bounds.y()); | 204 bounds.Offset(container_bounds.x(), container_bounds.y()); |
| 204 | 205 |
| 205 int scroll_x = 0; | 206 if (!node->data().is_fixed_positioned) { |
| 206 int scroll_y = 0; | 207 int scroll_x = 0; |
| 207 if (container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_X, &scroll_x) && | 208 int scroll_y = 0; |
| 208 container->data().GetIntAttribute(ui::AX_ATTR_SCROLL_Y, &scroll_y)) { | 209 if (container_data.GetIntAttribute(ui::AX_ATTR_SCROLL_X, &scroll_x) && |
| 209 bounds.Offset(-scroll_x, -scroll_y); | 210 container_data.GetIntAttribute(ui::AX_ATTR_SCROLL_Y, &scroll_y)) { |
| 211 bounds.Offset(-scroll_x, -scroll_y); |
| 212 } |
| 210 } | 213 } |
| 211 | 214 |
| 212 node = container; | 215 node = container; |
| 213 } | 216 } |
| 214 | 217 |
| 215 return bounds; | 218 return bounds; |
| 216 } | 219 } |
| 217 | 220 |
| 218 gfx::RectF AXTree::GetTreeBounds(const AXNode* node) const { | 221 gfx::RectF AXTree::GetTreeBounds(const AXNode* node) const { |
| 219 return RelativeToTreeBounds(node, gfx::RectF()); | 222 return RelativeToTreeBounds(node, gfx::RectF()); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 update_state->pending_nodes.insert(child); | 569 update_state->pending_nodes.insert(child); |
| 567 update_state->new_nodes.insert(child); | 570 update_state->new_nodes.insert(child); |
| 568 } | 571 } |
| 569 new_children->push_back(child); | 572 new_children->push_back(child); |
| 570 } | 573 } |
| 571 | 574 |
| 572 return success; | 575 return success; |
| 573 } | 576 } |
| 574 | 577 |
| 575 } // namespace ui | 578 } // namespace ui |
| OLD | NEW |