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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 1897443002: Load inline text boxes for focused element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | 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 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
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 if (ancestor.axID() == accessibility_focus_id_ ||
204 ancestor == GetMainDocument().focusedAccessibilityObject()) {
David Tseng 2016/04/18 23:38:13 Could this possibly give you more than you want? F
204 parent.loadInlineTextBoxes(); 205 parent.loadInlineTextBoxes();
205 break; 206 break;
206 } 207 }
207 ancestor = ancestor.parentObject(); 208 ancestor = ancestor.parentObject();
208 } 209 }
209 } 210 }
210 211
211 bool is_iframe = false; 212 bool is_iframe = false;
212 WebNode node = parent.node(); 213 WebNode node = parent.node();
213 if (!node.isNull() && node.isElementNode()) 214 if (!node.isNull() && node.isElementNode())
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 } 641 }
641 } 642 }
642 643
643 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { 644 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const {
644 if (render_frame_ && render_frame_->GetWebFrame()) 645 if (render_frame_ && render_frame_->GetWebFrame())
645 return render_frame_->GetWebFrame()->document(); 646 return render_frame_->GetWebFrame()->document();
646 return WebDocument(); 647 return WebDocument();
647 } 648 }
648 649
649 } // namespace content 650 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698