diff options
author | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 18:52:06 +0000 |
---|---|---|
committer | dglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-30 18:52:06 +0000 |
commit | 36f6d92c99043e3211ff6130e9e2478f10d73413 (patch) | |
tree | 88f567e6cb9b8ff503ed128bbccebc85b41f45b8 /webkit/tools | |
parent | dd8092593156db2fd6cc62cd770627d304d182e1 (diff) | |
download | chromium_src-36f6d92c99043e3211ff6130e9e2478f10d73413.zip chromium_src-36f6d92c99043e3211ff6130e9e2478f10d73413.tar.gz chromium_src-36f6d92c99043e3211ff6130e9e2478f10d73413.tar.bz2 |
Implement AccessibilityUIElement::isAttributeSettable plus other clean-up.
R=darin
BUG=10322
TEST=LayoutTests/accessibility/aria-readonly.html
Review URL: http://codereview.chromium.org/453006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools')
-rw-r--r-- | webkit/tools/test_shell/accessibility_ui_element.cc | 27 | ||||
-rw-r--r-- | webkit/tools/test_shell/accessibility_ui_element.h | 2 |
2 files changed, 27 insertions, 2 deletions
diff --git a/webkit/tools/test_shell/accessibility_ui_element.cc b/webkit/tools/test_shell/accessibility_ui_element.cc index bdf8d40..24f7a34 100644 --- a/webkit/tools/test_shell/accessibility_ui_element.cc +++ b/webkit/tools/test_shell/accessibility_ui_element.cc @@ -258,6 +258,7 @@ AccessibilityUIElement::AccessibilityUIElement( BindProperty("selectedTextRange", &selected_text_range); BindProperty("isEnabled", &AccessibilityUIElement::IsEnabledGetterCallback); BindProperty("isRequired", &is_required_); + BindProperty("isSelected", &AccessibilityUIElement::IsSelectedGetterCallback); BindProperty("valueDescription", &value_description_); BindFallbackMethod(&AccessibilityUIElement::FallbackCallback); @@ -279,10 +280,18 @@ std::string AccessibilityUIElement::GetDescription() { return description.insert(0, "AXDescription: "); } +std::string AccessibilityUIElement::GetRole() { + return RoleToString(accessibility_object().roleValue()); +} + void AccessibilityUIElement::AllAttributesCallback( const CppArgumentList& args, CppVariant* result) { // TODO(dglazkov): Concatenate all attributes of the AccessibilityObject. std::string attributes(GetTitle()); + attributes.append(" "); + attributes.append(GetRole()); + attributes.append(" "); + attributes.append(GetDescription()); result->Set(attributes); } @@ -409,7 +418,17 @@ void AccessibilityUIElement::AttributeValueCallback( void AccessibilityUIElement::IsAttributeSettableCallback( const CppArgumentList& args, CppVariant* result) { - result->SetNull(); + if (args.size() < 1 && !args[0].isString()) { + result->SetNull(); + return; + } + + std::string attribute = args[0].ToString(); + bool settable = false; + if (attribute == "AXValue") { + settable = accessibility_object().canSetValueAttribute(); + } + result->Set(settable); } void AccessibilityUIElement::IsActionSupportedCallback( @@ -455,8 +474,12 @@ void AccessibilityUIElement::IsEnabledGetterCallback(CppVariant* result) { result->Set(accessibility_object().isEnabled()); } +void AccessibilityUIElement::IsSelectedGetterCallback(CppVariant* result) { + result->SetNull(); +} + void AccessibilityUIElement::RoleGetterCallback(CppVariant* result) { - result->Set(RoleToString(accessibility_object().roleValue())); + result->Set(GetRole()); } void AccessibilityUIElement::TitleGetterCallback(CppVariant* result) { diff --git a/webkit/tools/test_shell/accessibility_ui_element.h b/webkit/tools/test_shell/accessibility_ui_element.h index c83e033..43db15d 100644 --- a/webkit/tools/test_shell/accessibility_ui_element.h +++ b/webkit/tools/test_shell/accessibility_ui_element.h @@ -26,6 +26,7 @@ class AccessibilityUIElement : public CppBoundClass { std::string GetTitle(); std::string GetDescription(); + std::string GetRole(); protected: const WebKit::WebAccessibilityObject& accessibility_object() const { @@ -83,6 +84,7 @@ class AccessibilityUIElement : public CppBoundClass { void ChildrenCountGetterCallback(CppVariant* result); void DescriptionGetterCallback(CppVariant* result); void IsEnabledGetterCallback(CppVariant* result); + void IsSelectedGetterCallback(CppVariant* result); void RoleGetterCallback(CppVariant* result); void TitleGetterCallback(CppVariant* result); |