| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/accessibility/blink_ax_tree_source.h" | 5 #include "content/renderer/accessibility/blink_ax_tree_source.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 int32_t BlinkAXTreeSource::GetId(blink::WebAXObject node) const { | 193 int32_t BlinkAXTreeSource::GetId(blink::WebAXObject node) const { |
| 194 return node.axID(); | 194 return node.axID(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void BlinkAXTreeSource::GetChildren( | 197 void BlinkAXTreeSource::GetChildren( |
| 198 blink::WebAXObject parent, | 198 blink::WebAXObject parent, |
| 199 std::vector<blink::WebAXObject>* out_children) const { | 199 std::vector<blink::WebAXObject>* out_children) const { |
| 200 if (parent.role() == blink::WebAXRoleStaticText) { | 200 if (parent.role() == blink::WebAXRoleStaticText) { |
| 201 blink::WebAXObject ancestor = parent; | 201 blink::WebAXObject ancestor = parent; |
| 202 while (!ancestor.isDetached()) { | 202 while (!ancestor.isDetached()) { |
| 203 if (ancestor.axID() == accessibility_focus_id_) { | 203 int32_t focus_id = GetMainDocument().focusedAccessibilityObject().axID(); |
| 204 if (ancestor.axID() == accessibility_focus_id_ || |
| 205 (ancestor.axID() == focus_id && ancestor.isEditable())) { |
| 204 parent.loadInlineTextBoxes(); | 206 parent.loadInlineTextBoxes(); |
| 205 break; | 207 break; |
| 206 } | 208 } |
| 207 ancestor = ancestor.parentObject(); | 209 ancestor = ancestor.parentObject(); |
| 208 } | 210 } |
| 209 } | 211 } |
| 210 | 212 |
| 211 bool is_iframe = false; | 213 bool is_iframe = false; |
| 212 WebNode node = parent.node(); | 214 WebNode node = parent.node(); |
| 213 if (!node.isNull() && node.isElementNode()) | 215 if (!node.isNull() && node.isElementNode()) |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 } | 656 } |
| 655 } | 657 } |
| 656 | 658 |
| 657 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 659 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 658 if (render_frame_ && render_frame_->GetWebFrame()) | 660 if (render_frame_ && render_frame_->GetWebFrame()) |
| 659 return render_frame_->GetWebFrame()->document(); | 661 return render_frame_->GetWebFrame()->document(); |
| 660 return WebDocument(); | 662 return WebDocument(); |
| 661 } | 663 } |
| 662 | 664 |
| 663 } // namespace content | 665 } // namespace content |
| OLD | NEW |