From cb6ec5471fa7015852d1df5f03cb8b9a02d3fc2e Mon Sep 17 00:00:00 2001 From: "dmazzoni@google.com" Date: Tue, 26 Mar 2013 06:14:17 +0000 Subject: Fix accessible bounding box when page is scrolled. This patch is for merging; will add new test to prevent this from happening again in subsequent changelist. See this diff from the changelist that broke it to see the bug: https://chromiumcodereview.appspot.com/12084028/diff/12004/content/browser/accessibility/browser_accessibility.cc Originally the scrolling logic was applied to the main frame. Change 12084028 intended to have it affect all frames, but instead it affected all frames except the root frame (which has a distinct role in the accessibility tree). BUG=223756 TBR=dtseng Review URL: https://codereview.chromium.org/13007004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190563 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/accessibility/browser_accessibility.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc index 82bee25..2c4b078 100644 --- a/content/browser/accessibility/browser_accessibility.cc +++ b/content/browser/accessibility/browser_accessibility.cc @@ -141,7 +141,8 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsRect() { // nested web area. BrowserAccessibility* parent = parent_; bool need_to_offset_web_area = - (role_ == AccessibilityNodeData::ROLE_WEB_AREA); + (role_ == AccessibilityNodeData::ROLE_WEB_AREA || + role_ == AccessibilityNodeData::ROLE_ROOT_WEB_AREA); while (parent) { if (need_to_offset_web_area && parent->location().width() > 0 && @@ -149,7 +150,8 @@ gfx::Rect BrowserAccessibility::GetLocalBoundsRect() { bounds.Offset(parent->location().x(), parent->location().y()); need_to_offset_web_area = false; } - if (parent->role() == AccessibilityNodeData::ROLE_WEB_AREA) { + if (parent->role() == AccessibilityNodeData::ROLE_WEB_AREA || + parent->role() == AccessibilityNodeData::ROLE_ROOT_WEB_AREA) { int sx = 0; int sy = 0; if (parent->GetIntAttribute(AccessibilityNodeData::ATTR_SCROLL_X, &sx) && -- cgit v1.1