зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1648341: Handle eHasValueMinMaxIfFocusable correctly in Accessible::Value. r=MarcoZ
Previously, this returned a value if the ARIA value rule was not eNoValue, which covered eHasValueMinMaxIfFocusable. However, eHasValueMinMaxIfFocusable needs the focusable state to be checked. Rather than checking the value rule directly, just use HasNumericValue(), which already knows how to handle this. Differential Revision: https://phabricator.services.mozilla.com/D81483
This commit is contained in:
Родитель
0398ff5ec9
Коммит
bb33c7f919
|
@ -1304,12 +1304,7 @@ void Accessible::ApplyARIAState(uint64_t* aState) const {
|
|||
}
|
||||
|
||||
void Accessible::Value(nsString& aValue) const {
|
||||
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
|
||||
|
||||
if ((roleMapEntry && roleMapEntry->valueRule != eNoValue) ||
|
||||
// Bug 1475376: aria-valuetext should also be supported for implicit ARIA
|
||||
// roles; e.g. <input type="range">.
|
||||
HasNumericValue()) {
|
||||
if (HasNumericValue()) {
|
||||
// aria-valuenow is a number, and aria-valuetext is the optional text
|
||||
// equivalent. For the string value, we will try the optional text
|
||||
// equivalent first.
|
||||
|
@ -1329,6 +1324,7 @@ void Accessible::Value(nsString& aValue) const {
|
|||
return;
|
||||
}
|
||||
|
||||
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
|
||||
if (!roleMapEntry) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -145,8 +145,10 @@
|
|||
testValue("range", "6", 6, 0, 10, 1);
|
||||
|
||||
// Test that elements which should not expose values do not
|
||||
var accSeparator = getAccessible("separator", [nsIAccessibleValue], null, DONOTFAIL_IF_NO_INTERFACE);
|
||||
ok(!accSeparator, "value interface is not exposed for separator");
|
||||
let separatorVal = getAccessible("separator", [nsIAccessibleValue], null, DONOTFAIL_IF_NO_INTERFACE);
|
||||
ok(!separatorVal, "value interface is not exposed for separator");
|
||||
let separatorAcc = getAccessible("separator");
|
||||
ok(!separatorAcc.value, "Value text is not exposed for separator");
|
||||
|
||||
// Test value change events
|
||||
gQueue = new eventQueue();
|
||||
|
|
Загрузка…
Ссылка в новой задаче