зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1804699: Assign date fields an AXGroup role, spoof actual role via AXTitle r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D172177
This commit is contained in:
Родитель
90401e3fba
Коммит
7d7067fe49
|
@ -711,7 +711,7 @@ ROLE(COLOR_CHOOSER,
|
|||
ROLE(DATE_EDITOR,
|
||||
"date editor",
|
||||
ATK_ROLE_DATE_EDITOR,
|
||||
@"AXDateField",
|
||||
@"AXGroup",
|
||||
NSAccessibilityUnknownSubrole,
|
||||
USE_ROLE_STRING,
|
||||
IA2_ROLE_DATE_EDITOR,
|
||||
|
|
|
@ -313,6 +313,9 @@ Class a11y::GetTypeFromRole(roles::Role aRole) {
|
|||
case roles::PAGETAB:
|
||||
return [mozTabAccessible class];
|
||||
|
||||
case roles::DATE_EDITOR:
|
||||
return [mozDatePickerAccessible class];
|
||||
|
||||
case roles::CHECKBUTTON:
|
||||
case roles::TOGGLE_BUTTON:
|
||||
case roles::SWITCH:
|
||||
|
|
|
@ -99,3 +99,10 @@
|
|||
- (void)changeValueBySteps:(int)factor;
|
||||
|
||||
@end
|
||||
|
||||
@interface mozDatePickerAccessible : mozAccessible
|
||||
|
||||
// override
|
||||
- (NSString*)moxTitle;
|
||||
|
||||
@end
|
||||
|
|
|
@ -229,3 +229,11 @@ using namespace mozilla::a11y;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation mozDatePickerAccessible
|
||||
|
||||
- (NSString*)moxTitle {
|
||||
return utils::LocalizedString(u"dateField"_ns);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -74,6 +74,7 @@ addAccessibleTask(
|
|||
<div id="tooltip" role="tooltip"></div>
|
||||
<input type="radio" role="menuitemradio" id="menuitemradio">
|
||||
<input type="checkbox" role="menuitemcheckbox" id="menuitemcheckbox">
|
||||
<input type="datetime-local" id="datetime">
|
||||
|
||||
<!-- text entries -->
|
||||
<div id="textbox_multiline" role="textbox" aria-multiline="true"></div>
|
||||
|
@ -187,6 +188,14 @@ addAccessibleTask(
|
|||
testRoleAndSubRole(accDoc, "tooltip", "AXGroup", "AXUserInterfaceTooltip");
|
||||
testRoleAndSubRole(accDoc, "menuitemradio", "AXMenuItem", null);
|
||||
testRoleAndSubRole(accDoc, "menuitemcheckbox", "AXMenuItem", null);
|
||||
testRoleAndSubRole(accDoc, "datetime", "AXGroup", null);
|
||||
// XXX for datetime elements, we spoof the role via the title, since
|
||||
// providing the correct role results in the internal elements being
|
||||
// unreachable by VO
|
||||
is(
|
||||
getNativeInterface(accDoc, "datetime").getAttributeValue("AXTitle"),
|
||||
"date field"
|
||||
);
|
||||
|
||||
// Text boxes
|
||||
testRoleAndSubRole(accDoc, "textbox_multiline", "AXTextArea");
|
||||
|
|
|
@ -31,6 +31,8 @@ term = term
|
|||
definition = definition
|
||||
# The Role Description for an input type="search" text field
|
||||
searchTextField = search text field
|
||||
# Role Description (exposed as AXTitle) for datepickers
|
||||
dateField = date field
|
||||
# The Role Description for WAI-ARIA Landmarks
|
||||
application = application
|
||||
search = search
|
||||
|
|
Загрузка…
Ссылка в новой задаче