summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webaccessibility.cc
diff options
context:
space:
mode:
authorctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 01:59:37 +0000
committerctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 01:59:37 +0000
commit70eee34d2d158dc51086b9571e62a61ace16727b (patch)
treeb6532b9fe9fb38f8fcb6cbe89a9fb36b1c2d964b /webkit/glue/webaccessibility.cc
parenta9a430111290193028dc2b39be75c176d49d7bd3 (diff)
downloadchromium_src-70eee34d2d158dc51086b9571e62a61ace16727b.zip
chromium_src-70eee34d2d158dc51086b9571e62a61ace16727b.tar.gz
chromium_src-70eee34d2d158dc51086b9571e62a61ace16727b.tar.bz2
Only send child node updates on load and children changed notifications.
BUG=none TEST=interactive_ui_tests:AccessibilityWinBrowserTest.* Review URL: http://codereview.chromium.org/4272002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webaccessibility.cc')
-rw-r--r--webkit/glue/webaccessibility.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc
index f405331..0888a62 100644
--- a/webkit/glue/webaccessibility.cc
+++ b/webkit/glue/webaccessibility.cc
@@ -297,15 +297,17 @@ WebAccessibility::WebAccessibility()
}
WebAccessibility::WebAccessibility(const WebKit::WebAccessibilityObject& src,
- WebKit::WebAccessibilityCache* cache) {
- Init(src, cache);
+ WebKit::WebAccessibilityCache* cache,
+ bool include_children) {
+ Init(src, cache, include_children);
}
WebAccessibility::~WebAccessibility() {
}
void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
- WebKit::WebAccessibilityCache* cache) {
+ WebKit::WebAccessibilityCache* cache,
+ bool include_children) {
name = src.title();
value = src.stringValue();
role = ConvertRole(src.roleValue());
@@ -376,17 +378,19 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
// Add the source object to the cache and store its id.
id = cache->addOrGetId(src);
- // Recursively create children.
- int child_count = src.childCount();
- for (int i = 0; i < child_count; i++) {
- WebAccessibilityObject child = src.childAt(i);
-
- // The child may be invalid due to issues in webkit accessibility code.
- // Don't add children are invalid thus preventing a crash.
- // https://bugs.webkit.org/show_bug.cgi?id=44149
- // TODO(ctguil): We may want to remove this check as webkit stabilizes.
- if (child.isValid())
- children.push_back(WebAccessibility(child, cache));
+ if (include_children) {
+ // Recursively create children.
+ int child_count = src.childCount();
+ for (int i = 0; i < child_count; i++) {
+ WebAccessibilityObject child = src.childAt(i);
+
+ // The child may be invalid due to issues in webkit accessibility code.
+ // Don't add children are invalid thus preventing a crash.
+ // https://bugs.webkit.org/show_bug.cgi?id=44149
+ // TODO(ctguil): We may want to remove this check as webkit stabilizes.
+ if (child.isValid())
+ children.push_back(WebAccessibility(child, cache, include_children));
+ }
}
}