summaryrefslogtreecommitdiffstats
path: root/content/renderer/renderer_accessibility.cc
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 07:44:21 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-01 07:44:21 +0000
commit85aab54f70cb49916c5d79540544eead19f37dc0 (patch)
treebfd65e8d34e82571387a208f7d7efa2016b729d6 /content/renderer/renderer_accessibility.cc
parent65f6b00328d555ea1eaaf778ea653f68560491ba (diff)
downloadchromium_src-85aab54f70cb49916c5d79540544eead19f37dc0.zip
chromium_src-85aab54f70cb49916c5d79540544eead19f37dc0.tar.gz
chromium_src-85aab54f70cb49916c5d79540544eead19f37dc0.tar.bz2
Make sure the document's scroll position is always up-to-date before
sending an accessibility notification. This can be removed once https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed, but it's useful to have this change in the meantime because it enables progress on other bugs to proceed in the meantime. BUG=72318,104468 TEST=Compare the rects of web objects using accessibility inspectors before and after scrolling. Review URL: http://codereview.chromium.org/8748019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/renderer_accessibility.cc')
-rw-r--r--content/renderer/renderer_accessibility.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/renderer/renderer_accessibility.cc b/content/renderer/renderer_accessibility.cc
index 2ca15dd..5f81af8 100644
--- a/content/renderer/renderer_accessibility.cc
+++ b/content/renderer/renderer_accessibility.cc
@@ -81,6 +81,7 @@ RendererAccessibility::RendererAccessibility(RenderViewImpl* render_view)
: content::RenderViewObserver(render_view),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
browser_root_(NULL),
+ last_scroll_offset_(gfx::Size()),
ack_pending_(false),
logging_(false),
sent_load_complete_(false) {
@@ -164,6 +165,19 @@ void RendererAccessibility::PostAccessibilityNotification(
WebKit::WebAccessibilityNotificationLoadComplete);
}
+ gfx::Size scroll_offset = document.frame()->scrollOffset();
+ if (scroll_offset != last_scroll_offset_) {
+ // Make sure the browser is always aware of the scroll position of
+ // the root document element by posting a generic notification that
+ // will update it.
+ // TODO(dmazzoni): remove this as soon as
+ // https://bugs.webkit.org/show_bug.cgi?id=73460 is fixed.
+ last_scroll_offset_ = scroll_offset;
+ PostAccessibilityNotification(
+ document.accessibilityObject(),
+ WebKit::WebAccessibilityNotificationLayoutComplete);
+ }
+
if (notification == WebKit::WebAccessibilityNotificationLoadComplete)
sent_load_complete_ = true;