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

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

Issue 799633007: Make Windows accessibility event firing aware of guest / child frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webview_fixes
Patch Set: Address more feedback Created 5 years, 11 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 0a3719d4aaf401902b67ef3a8ffe55232bf0e35e..6ab4acdcf59fb6d982e80acb6442dc434e1d52af 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -184,7 +184,7 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsRect() const {
// Walk up the parent chain. Every time we encounter a Web Area, offset
// based on the scroll bars and then offset based on the origin of that
// nested web area.
- BrowserAccessibility* parent = GetParent();
+ BrowserAccessibility* parent = GetParentForBoundsCalculation();
bool need_to_offset_web_area =
(GetRole() == ui::AX_ROLE_WEB_AREA ||
GetRole() == ui::AX_ROLE_ROOT_WEB_AREA);
@@ -213,7 +213,7 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsRect() const {
}
need_to_offset_web_area = true;
}
- parent = parent->GetParent();
+ parent = parent->GetParentForBoundsCalculation();
}
return bounds;
@@ -723,4 +723,23 @@ int BrowserAccessibility::GetStaticTextLenRecursive() const {
return len;
}
+BrowserAccessibility* BrowserAccessibility::GetParentForBoundsCalculation()
+ const {
+ if (!node_ || !manager_)
+ return NULL;
+ ui::AXNode* parent = node_->parent();
+ if (parent)
+ return manager_->GetFromAXNode(parent);
+
+ if (!manager_->delegate())
+ return NULL;
+
+ BrowserAccessibility* host_node =
+ manager_->delegate()->AccessibilityGetParentFrame();
+ if (!host_node)
+ return NULL;
+
+ return host_node;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698