Chromium Code Reviews| Index: ui/accessibility/ax_node.cc |
| diff --git a/ui/accessibility/ax_node.cc b/ui/accessibility/ax_node.cc |
| index 459095eef929ad0b4aa66e1e92efda852674b993..36f47269ab4980b1b908f395b5e6a42ad60a1db9 100644 |
| --- a/ui/accessibility/ax_node.cc |
| +++ b/ui/accessibility/ax_node.cc |
| @@ -60,27 +60,27 @@ std::vector<int> AXNode::GetOrComputeLineStartOffsets() { |
| if (data().GetIntListAttribute(AX_ATTR_CACHED_LINE_STARTS, &line_offsets)) |
| return line_offsets; |
| - int end_offset = 0; |
| - ComputeLineStartOffsets(&line_offsets, &end_offset); |
| + int start_offset = 0; |
| + ComputeLineStartOffsets(&line_offsets, &start_offset); |
| data_.AddIntListAttribute(AX_ATTR_CACHED_LINE_STARTS, line_offsets); |
| return line_offsets; |
| } |
| void AXNode::ComputeLineStartOffsets(std::vector<int>* line_offsets, |
| - int* end_offset) const { |
| + int* start_offset) const { |
| DCHECK(line_offsets); |
| - DCHECK(end_offset); |
| + DCHECK(start_offset); |
| for (const AXNode* child : children()) { |
| DCHECK(child); |
| if (child->child_count()) { |
| - child->ComputeLineStartOffsets(line_offsets, end_offset); |
| + child->ComputeLineStartOffsets(line_offsets, start_offset); |
| continue; |
| } |
| + if (!child->data().HasIntAttribute(ui::AX_ATTR_PREVIOUS_ON_LINE_ID)) |
|
David Tseng
2016/10/19 17:39:42
This is still wrong...
- this would include 0; th
|
| + line_offsets->push_back(*start_offset); |
| base::string16 text = child->data().GetString16Attribute(ui::AX_ATTR_NAME); |
| - *end_offset += static_cast<int>(text.length()); |
| - if (!child->data().HasIntAttribute(ui::AX_ATTR_NEXT_ON_LINE_ID)) |
| - line_offsets->push_back(*end_offset); |
| + *start_offset += static_cast<int>(text.length()); |
| } |
| } |