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

Unified Diff: content/browser/accessibility/browser_accessibility.cc

Issue 1155993003: Fix accessibility with out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 5 years, 6 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 | « no previous file | content/browser/accessibility/site_per_process_accessibility_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility.cc
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index 9d4fe101afc599be1f15caf17a87cdfc0a74103b..1e2b2079f68cac0c8c773155a45fdb783fa09f28 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -60,6 +60,14 @@ bool BrowserAccessibility::PlatformIsLeaf() const {
}
uint32 BrowserAccessibility::PlatformChildCount() const {
+ if (GetBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
+ // Check if the child frame currently exists.
+ if (manager_->delegate()->AccessibilityGetChildFrame(GetId()))
+ return 1;
+
+ return 0;
+ }
+
return PlatformIsLeaf() ? 0 : InternalChildCount();
}
@@ -80,14 +88,16 @@ bool BrowserAccessibility::IsDescendantOf(
BrowserAccessibility* BrowserAccessibility::PlatformGetChild(
uint32 child_index) const {
- DCHECK(child_index < InternalChildCount());
- BrowserAccessibility* result = InternalGetChild(child_index);
+ DCHECK(child_index < PlatformChildCount());
+ BrowserAccessibility* result = nullptr;
- if (result->HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
+ if (HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
dmazzoni 2015/06/25 22:57:13 Let's make this GetBoolAttribute too
lfg 2015/06/25 23:14:25 Done.
BrowserAccessibilityManager* child_manager =
- manager_->delegate()->AccessibilityGetChildFrame(result->GetId());
+ manager_->delegate()->AccessibilityGetChildFrame(GetId());
if (child_manager)
result = child_manager->GetRoot();
+ } else {
+ result = InternalGetChild(child_index);
}
return result;
@@ -150,7 +160,7 @@ BrowserAccessibility* BrowserAccessibility::GetParent() const {
if (!host_node)
return NULL;
- return host_node->GetParent();
+ return host_node;
}
int32 BrowserAccessibility::GetIndexInParent() const {
« no previous file with comments | « no previous file | content/browser/accessibility/site_per_process_accessibility_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698