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

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

Issue 637423003: Send AX event on nearest unignored ancestor of target. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@child_frame_no_ax_needed
Patch Set: Created 6 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_accessibility_complete.h" 5 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 AccessibilityHostMsg_EventParams& event = src_events[i]; 202 AccessibilityHostMsg_EventParams& event = src_events[i];
203 if (event.event_type == ui::AX_EVENT_LAYOUT_COMPLETE) 203 if (event.event_type == ui::AX_EVENT_LAYOUT_COMPLETE)
204 had_layout_complete_messages = true; 204 had_layout_complete_messages = true;
205 205
206 WebAXObject obj = document.accessibilityObjectFromID(event.id); 206 WebAXObject obj = document.accessibilityObjectFromID(event.id);
207 207
208 // Make sure the object still exists. 208 // Make sure the object still exists.
209 if (!obj.updateBackingStoreAndCheckValidity()) 209 if (!obj.updateBackingStoreAndCheckValidity())
210 continue; 210 continue;
211 211
212 // If it's ignored, find the first ancestor that's not ignored.
213 while (!obj.isDetached() && obj.accessibilityIsIgnored())
214 obj = obj.parentObject();
215
212 // Make sure it's a descendant of our root node - exceptions include the 216 // Make sure it's a descendant of our root node - exceptions include the
213 // scroll area that's the parent of the main document (we ignore it), and 217 // scroll area that's the parent of the main document (we ignore it), and
214 // possibly nodes attached to a different document. 218 // possibly nodes attached to a different document.
215 if (!tree_source_.IsInTree(obj)) 219 if (!tree_source_.IsInTree(obj))
216 continue; 220 continue;
217 221
218 // When we get a "selected children changed" event, Blink 222 // When we get a "selected children changed" event, Blink
219 // doesn't also send us events for each child that changed 223 // doesn't also send us events for each child that changed
220 // selection state, so make sure we re-send that whole subtree. 224 // selection state, so make sure we re-send that whole subtree.
221 if (event.event_type == 225 if (event.event_type ==
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement(); 433 render_frame_->GetRenderView()->GetWebView()->clearFocusedElement();
430 else 434 else
431 obj.setFocused(true); 435 obj.setFocused(true);
432 } 436 }
433 437
434 void RendererAccessibilityComplete::OnFatalError() { 438 void RendererAccessibilityComplete::OnFatalError() {
435 CHECK(false) << "Invalid accessibility tree."; 439 CHECK(false) << "Invalid accessibility tree.";
436 } 440 }
437 441
438 } // namespace content 442 } // 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