Bug 1121518 - ARIA 1.1: Add support for role 'searchbox', r=surkov

This commit is contained in:
Marco Zehe
2015-02-27 15:41:57 +01:00
parent ed41a3d644
commit 6af0417391
11 changed files with 63 additions and 8 deletions

View File

@@ -306,8 +306,13 @@ HTMLTextFieldAccessible::NativeAttributes()
// Expose type for text input elements as it gives some useful context,
// especially for mobile.
nsAutoString type;
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type))
if (mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type)) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::textInputType, type);
if (!mRoleMapEntry && type.EqualsLiteral("search")) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::xmlroles,
NS_LITERAL_STRING("searchbox"));
}
}
return attributes.forget();
}