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

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

Issue 12084028: Fix accessibility coordinates within iframes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Mac helper functions Created 7 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/dump_accessibility_tree_helper_win.cc
diff --git a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
index 0168ba2779efad9e2633c873849dcd93a4f5481a..4c5e2c6ea39d9e81c2436217a077d6a9b175f52a 100644
--- a/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
+++ b/content/browser/accessibility/dump_accessibility_tree_helper_win.cc
@@ -12,6 +12,7 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
+#include "content/browser/accessibility/browser_accessibility_manager.h"
#include "content/browser/accessibility/browser_accessibility_win.h"
#include "content/common/accessibility_node_data.h"
#include "content/public/test/accessibility_test_utils_win.h"
@@ -100,10 +101,15 @@ string16 DumpAccessibilityTreeHelper::ToString(
Add(false, L"description='" + description + L"'");
Add(false, L"default_action='" + default_action + L"'");
Add(false, L"keyboard_shortcut='" + keyboard_shortcut + L"'");
- LONG x_left, y_top, width, height;
- if (acc_obj->accLocation(&x_left, &y_top, &width, &height, variant_self) !=
- S_FALSE) {
- Add(false, StringPrintf(L"location=(%d, %d)", x_left, y_top));
+ BrowserAccessibility* root = node->manager()->GetRoot();
+ LONG left, top, width, height;
+ LONG root_left, root_top, root_width, root_height;
+ if (S_FALSE != acc_obj->accLocation(
aboxhall 2013/01/29 17:43:27 It always makes me sad when APIs force you to use
+ &left, &top, &width, &height, variant_self) &&
+ S_FALSE != root->ToBrowserAccessibilityWin()->accLocation(
+ &root_left, &root_top, &root_width, &root_height, variant_self)) {
+ Add(false, StringPrintf(L"location=(%d, %d)",
+ left - root_left, top - root_top));
Add(false, StringPrintf(L"size=(%d, %d)", width, height));
}
LONG index_in_parent;

Powered by Google App Engine
This is Rietveld 408576698