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

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

Issue 275503002: Ignore accessibility events fired on objects that aren't in the tree. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 // Loop over each event and generate an updated event message. 180 // Loop over each event and generate an updated event message.
181 for (size_t i = 0; i < src_events.size(); ++i) { 181 for (size_t i = 0; i < src_events.size(); ++i) {
182 AccessibilityHostMsg_EventParams& event = 182 AccessibilityHostMsg_EventParams& event =
183 src_events[i]; 183 src_events[i];
184 184
185 WebAXObject obj = document.accessibilityObjectFromID( 185 WebAXObject obj = document.accessibilityObjectFromID(
186 event.id); 186 event.id);
187 if (!obj.updateBackingStoreAndCheckValidity()) 187 if (!obj.updateBackingStoreAndCheckValidity())
188 continue; 188 continue;
189 if (!tree_source_.IsInTree(obj))
Peter Lundblad 2014/05/07 23:03:24 Can you add some brief comment why the node wouldn
dmazzoni 2014/05/08 15:12:23 Done.
190 continue;
189 191
190 // When we get a "selected children changed" event, Blink 192 // When we get a "selected children changed" event, Blink
191 // doesn't also send us events for each child that changed 193 // doesn't also send us events for each child that changed
192 // selection state, so make sure we re-send that whole subtree. 194 // selection state, so make sure we re-send that whole subtree.
193 if (event.event_type == 195 if (event.event_type ==
194 ui::AX_EVENT_SELECTED_CHILDREN_CHANGED) { 196 ui::AX_EVENT_SELECTED_CHILDREN_CHANGED) {
195 serializer_.DeleteClientSubtree(obj); 197 serializer_.DeleteClientSubtree(obj);
196 } 198 }
197 199
198 AccessibilityHostMsg_EventParams event_msg; 200 AccessibilityHostMsg_EventParams event_msg;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 render_view()->GetWebView()->clearFocusedElement(); 377 render_view()->GetWebView()->clearFocusedElement();
376 else 378 else
377 obj.setFocused(true); 379 obj.setFocused(true);
378 } 380 }
379 381
380 void RendererAccessibilityComplete::OnFatalError() { 382 void RendererAccessibilityComplete::OnFatalError() {
381 CHECK(false) << "Invalid accessibility tree."; 383 CHECK(false) << "Invalid accessibility tree.";
382 } 384 }
383 385
384 } // namespace content 386 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698