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

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: Force re-serialization when focus changes Created 4 years, 7 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 | content/renderer/accessibility/renderer_accessibility.cc » ('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 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 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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/accessibility/renderer_accessibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698