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

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: fix dcheck/android build 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
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..514b1fce0b32e7bd958c76002057ae0a035e8d59 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -60,6 +60,9 @@ bool BrowserAccessibility::PlatformIsLeaf() const {
}
uint32 BrowserAccessibility::PlatformChildCount() const {
+ if (HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST))
dmazzoni 2015/06/25 22:15:38 Not due to your change, but let's change this to G
lfg 2015/06/25 22:48:24 Done. I also changed the DCHECK below to call this
+ return 1;
+
return PlatformIsLeaf() ? 0 : InternalChildCount();
}
@@ -80,14 +83,17 @@ bool BrowserAccessibility::IsDescendantOf(
BrowserAccessibility* BrowserAccessibility::PlatformGetChild(
uint32 child_index) const {
- DCHECK(child_index < InternalChildCount());
- BrowserAccessibility* result = InternalGetChild(child_index);
+ DCHECK((child_index == 0 && HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) ||
+ child_index < InternalChildCount());
+ BrowserAccessibility* result = nullptr;
- if (result->HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
+ if (HasBoolAttribute(ui::AX_ATTR_IS_AX_TREE_HOST)) {
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 +156,7 @@ BrowserAccessibility* BrowserAccessibility::GetParent() const {
if (!host_node)
return NULL;
- return host_node->GetParent();
+ return host_node;
}
int32 BrowserAccessibility::GetIndexInParent() const {

Powered by Google App Engine
This is Rietveld 408576698