OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/webaccessibility.h" | 5 #include "webkit/glue/webaccessibility.h" |
6 | 6 |
7 #include "base/string_number_conversions.h" | 7 #include "base/string_number_conversions.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityCache .h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityCache .h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 attributes[ATTR_DOC_DOCTYPE] = doctype.name(); | 373 attributes[ATTR_DOC_DOCTYPE] = doctype.name(); |
374 | 374 |
375 const gfx::Size& scroll_offset = document.frame()->scrollOffset(); | 375 const gfx::Size& scroll_offset = document.frame()->scrollOffset(); |
376 attributes[ATTR_DOC_SCROLLX] = base::IntToString16(scroll_offset.width()); | 376 attributes[ATTR_DOC_SCROLLX] = base::IntToString16(scroll_offset.width()); |
377 attributes[ATTR_DOC_SCROLLY] = base::IntToString16(scroll_offset.height()); | 377 attributes[ATTR_DOC_SCROLLY] = base::IntToString16(scroll_offset.height()); |
378 } | 378 } |
379 | 379 |
380 // Add the source object to the cache and store its id. | 380 // Add the source object to the cache and store its id. |
381 id = cache->addOrGetId(src); | 381 id = cache->addOrGetId(src); |
382 | 382 |
383 if (role == WebAccessibility::ROLE_EDITABLE_TEXT || | |
Chris Guillory
2011/02/18 01:43:17
Nit: Add comment explaining why we shouldn't inclu
| |
384 role == WebAccessibility::ROLE_TEXTAREA || | |
385 role == WebAccessibility::ROLE_TEXT_FIELD) { | |
386 include_children = false; | |
387 } | |
388 | |
383 if (include_children) { | 389 if (include_children) { |
384 // Recursively create children. | 390 // Recursively create children. |
385 int child_count = src.childCount(); | 391 int child_count = src.childCount(); |
386 for (int i = 0; i < child_count; i++) { | 392 for (int i = 0; i < child_count; i++) { |
387 WebAccessibilityObject child = src.childAt(i); | 393 WebAccessibilityObject child = src.childAt(i); |
388 | 394 |
389 // The child may be invalid due to issues in webkit accessibility code. | 395 // The child may be invalid due to issues in webkit accessibility code. |
390 // Don't add children are invalid thus preventing a crash. | 396 // Don't add children are invalid thus preventing a crash. |
391 // https://bugs.webkit.org/show_bug.cgi?id=44149 | 397 // https://bugs.webkit.org/show_bug.cgi?id=44149 |
392 // TODO(ctguil): We may want to remove this check as webkit stabilizes. | 398 // TODO(ctguil): We may want to remove this check as webkit stabilizes. |
393 if (child.isValid()) | 399 if (child.isValid()) |
394 children.push_back(WebAccessibility(child, cache, include_children)); | 400 children.push_back(WebAccessibility(child, cache, include_children)); |
395 } | 401 } |
396 } | 402 } |
397 } | 403 } |
398 | 404 |
399 } // namespace webkit_glue | 405 } // namespace webkit_glue |
OLD | NEW |