зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1475376: Support aria-valuetext for implicit ARIA roles. r=MarcoZ
For example, <input type="range"> maps to role="slider", so aria-valuetext should be supported. MozReview-Commit-ID: IYBVTHP3ZLo --HG-- extra : rebase_source : 906dfacf92d040abf97b46ff67bafbabc5c9a1ea
This commit is contained in:
Родитель
7581aff013
Коммит
e5a1c32097
|
@ -1355,10 +1355,11 @@ void
|
|||
Accessible::Value(nsString& aValue) const
|
||||
{
|
||||
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
|
||||
if (!roleMapEntry)
|
||||
return;
|
||||
|
||||
if (roleMapEntry->valueRule != eNoValue) {
|
||||
if ((roleMapEntry && roleMapEntry->valueRule != eNoValue) ||
|
||||
// Bug 1475376: aria-valuetext should also be supported for implicit ARIA
|
||||
// roles; e.g. <input type="range">.
|
||||
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.
|
||||
|
@ -1374,6 +1375,10 @@ Accessible::Value(nsString& aValue) const
|
|||
return;
|
||||
}
|
||||
|
||||
if (!roleMapEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Value of textbox is a textified subtree.
|
||||
if (roleMapEntry->Is(nsGkAtoms::textbox)) {
|
||||
nsTextEquivUtils::GetTextEquivFromSubtree(this, aValue);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
testValue("pr_one", "100%", 1, 0, 1, 0);
|
||||
testValue("pr_42", "100%", 42, 0, 1, 0);
|
||||
testValue("pr_21", "50%", 21, 0, 42, 0);
|
||||
testValue("pr_valuetext", "value", 0, 0, 1, 0);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -56,5 +57,7 @@
|
|||
<progress id="pr_one" value="1">this will be read by legacy browsers</progress>
|
||||
<progress id="pr_42" value="42">this will be read by legacy browsers</progress>
|
||||
<progress id="pr_21" value="21" max="42">this will be read by legacy browsers</progress>
|
||||
<!-- aria-valuetext should work due to implicit progressbar role (bug 1475376) -->
|
||||
<progress id="pr_valuetext" aria-valuetext="value">this will be read by legacy browsers</progress>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
testValue("range_step", "50", 50, 0, 100, 1);
|
||||
testValue("range_min42", "71", 71, 42, 100, 1);
|
||||
testValue("range_max42", "21", 21, 0, 42, 1);
|
||||
testValue("range_valuetext", "value", 50, 0, 100, 1);
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
@ -54,5 +55,7 @@
|
|||
<input type="range" id="range_step" step="1">
|
||||
<input type="range" id="range_min42" min="42">
|
||||
<input type="range" id="range_max42" max="42">
|
||||
<!-- aria-valuetext should work due to implicit slider role (bug 1475376) -->
|
||||
<input type="range" id="range_valuetext" aria-valuetext="value">
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче