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

Unified Diff: content/renderer/accessibility/renderer_accessibility.cc

Issue 1347243005: Make selection changes in a text field invalidate accessibility tree root. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable RendererAccessibilityTest.TextSelectionShouldSendRoot for Android; all other tests in this … Created 5 years, 3 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
Index: content/renderer/accessibility/renderer_accessibility.cc
diff --git a/content/renderer/accessibility/renderer_accessibility.cc b/content/renderer/accessibility/renderer_accessibility.cc
index 5846b9a58f38e8ac03176b7aa5af2beab9a530c8..812af620fca0a7fe15f92977ab3117e9351f41d8 100644
--- a/content/renderer/accessibility/renderer_accessibility.cc
+++ b/content/renderer/accessibility/renderer_accessibility.cc
@@ -186,6 +186,15 @@ void RendererAccessibility::HandleAXEvent(
}
}
+ if (event == ui::AX_EVENT_TEXT_SELECTION_CHANGED &&
+ obj.isFocused() &&
+ !obj.equals(document.accessibilityObject())) {
+ // Changing the text selection in a text field may invalidate
+ // the anchor/focus attributes on the tree root. Send a generic
+ // notification to have it updated.
+ HandleAXEvent(document.accessibilityObject(), event);
+ }
+
// Add the accessibility object to our cache and ensure it's valid.
AccessibilityHostMsg_EventParams acc_event;
acc_event.id = obj.axID();

Powered by Google App Engine
This is Rietveld 408576698