mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 721001 - Instantiate the right class and set the proper subrole for password field. r=
This commit is contained in:
parent
894ca6a0ef
commit
6a9f5dc297
@ -232,7 +232,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
|
||||
if (mRole == roles::DOCUMENT)
|
||||
return utils::LocalizedString(NS_LITERAL_STRING("htmlContent"));
|
||||
|
||||
return NSAccessibilityRoleDescription([self role], nil);
|
||||
return NSAccessibilityRoleDescription([self role], [self subrole]);
|
||||
}
|
||||
|
||||
if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
|
||||
|
@ -290,7 +290,9 @@ ToNSString(id aValue)
|
||||
|
||||
- (NSString*)subrole
|
||||
{
|
||||
// TODO: text accessibles have two different subroles in Cocoa: secure textfield (passwords) and search field
|
||||
if(mRole == roles::PASSWORD_TEXT)
|
||||
return NSAccessibilitySecureTextFieldSubrole;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
@ -347,7 +349,11 @@ ToNSString(id aValue)
|
||||
{
|
||||
if (!mGeckoTextAccessible)
|
||||
return nil;
|
||||
|
||||
|
||||
// A password text field returns an empty value
|
||||
if (mRole == roles::PASSWORD_TEXT)
|
||||
return @"";
|
||||
|
||||
nsAutoString text;
|
||||
nsresult rv = mGeckoTextAccessible->
|
||||
GetText(0, nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, text);
|
||||
|
@ -121,6 +121,7 @@ nsAccessibleWrap::GetNativeType ()
|
||||
case roles::CAPTION:
|
||||
case roles::ACCEL_LABEL:
|
||||
case roles::TEXT_LEAF:
|
||||
case roles::PASSWORD_TEXT:
|
||||
// normal textfield (static or editable)
|
||||
return [mozTextAccessible class];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user