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

Unified 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: Add Android suppression 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/accessibility/renderer_accessibility_complete.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/accessibility/renderer_accessibility_complete.cc
diff --git a/content/renderer/accessibility/renderer_accessibility_complete.cc b/content/renderer/accessibility/renderer_accessibility_complete.cc
index 4a9de8f017da41809f384d46e687d5b1ba59dbc4..e8236988c086e2076e1ca43eebbadb6434fbf803 100644
--- a/content/renderer/accessibility/renderer_accessibility_complete.cc
+++ b/content/renderer/accessibility/renderer_accessibility_complete.cc
@@ -184,8 +184,14 @@ void RendererAccessibilityComplete::SendPendingAccessibilityEvents() {
WebAXObject obj = document.accessibilityObjectFromID(
event.id);
+ // Make sure the object still exists.
if (!obj.updateBackingStoreAndCheckValidity())
continue;
+ // Make sure it's a descendant of our root node - exceptions include the
+ // scroll area that's the parent of the main document (we ignore it), and
+ // possibly nodes attached to a different document.
+ if (!tree_source_.IsInTree(obj))
+ continue;
// When we get a "selected children changed" event, Blink
// doesn't also send us events for each child that changed
« no previous file with comments | « content/renderer/accessibility/renderer_accessibility_complete.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698