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

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

Issue 2956053005: Keep track of fixed positioning in accessibility tree.
Patch Set: GetSimpleRelativeBounds, add failing test for fixed with transform Created 3 years, 5 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_node.h ('k') | ui/accessibility/ax_node_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_node.h" 5 #include "ui/accessibility/ax_node.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "ui/accessibility/ax_enums.h" 10 #include "ui/accessibility/ax_enums.h"
(...skipping 14 matching lines...) Expand all
25 data().role == AX_ROLE_LINE_BREAK || 25 data().role == AX_ROLE_LINE_BREAK ||
26 data().role == AX_ROLE_INLINE_TEXT_BOX; 26 data().role == AX_ROLE_INLINE_TEXT_BOX;
27 } 27 }
28 28
29 void AXNode::SetData(const AXNodeData& src) { 29 void AXNode::SetData(const AXNodeData& src) {
30 data_ = src; 30 data_ = src;
31 } 31 }
32 32
33 void AXNode::SetLocation(int offset_container_id, 33 void AXNode::SetLocation(int offset_container_id,
34 const gfx::RectF& location, 34 const gfx::RectF& location,
35 gfx::Transform* transform) { 35 gfx::Transform* transform,
36 bool is_fixed_positioned) {
36 data_.offset_container_id = offset_container_id; 37 data_.offset_container_id = offset_container_id;
37 data_.location = location; 38 data_.location = location;
38 if (transform) 39 if (transform)
39 data_.transform.reset(new gfx::Transform(*transform)); 40 data_.transform.reset(new gfx::Transform(*transform));
40 else 41 else
41 data_.transform.reset(nullptr); 42 data_.transform.reset(nullptr);
43 data_.is_fixed_positioned = is_fixed_positioned;
42 } 44 }
43 45
44 void AXNode::SetIndexInParent(int index_in_parent) { 46 void AXNode::SetIndexInParent(int index_in_parent) {
45 index_in_parent_ = index_in_parent; 47 index_in_parent_ = index_in_parent;
46 } 48 }
47 49
48 void AXNode::SwapChildren(std::vector<AXNode*>& children) { 50 void AXNode::SwapChildren(std::vector<AXNode*>& children) {
49 children.swap(children_); 51 children.swap(children_);
50 } 52 }
51 53
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 if (line_offsets->empty() || line_offsets->back() != *start_offset) 94 if (line_offsets->empty() || line_offsets->back() != *start_offset)
93 line_offsets->push_back(*start_offset); 95 line_offsets->push_back(*start_offset);
94 } 96 }
95 97
96 base::string16 text = child->data().GetString16Attribute(ui::AX_ATTR_NAME); 98 base::string16 text = child->data().GetString16Attribute(ui::AX_ATTR_NAME);
97 *start_offset += static_cast<int>(text.length()); 99 *start_offset += static_cast<int>(text.length());
98 } 100 }
99 } 101 }
100 102
101 } // namespace ui 103 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node.h ('k') | ui/accessibility/ax_node_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698