Closed Bug 1357071 Opened 3 years ago Closed 3 months ago

Implement support for implicit values for aria-value* attributes for scrollbar and slider roles

Categories

(Core :: Disability Access APIs, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jdiggs, Assigned: mislam, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=c++])

Attachments

(1 file)

In ARIA 1.1, aria-valuemin, aria-valuenow, and aria-valuemax were given default implicit values for scrollbar and slider:

* aria-valuemin is 0
* aria-valuemax is 100
* aria-valuenow is half way between aria-valuemin and aria-valuemax

1. Load data:text/html,<div tabindex="0" role="scrollbar" />
2. Use Accerciser to examine the element
3. Load data:text/html,<div tabindex="0" role="slider" />
4. Use Accerciser to examine the element

Expected result: The accessible value interface would report a minimum of 0, a maximum of 100, and a current value of 50.

Actual result: All values are 0.

Note: All values are 0 if you use Accerciser's interface viewer. If you instead use its ipython console, the current and maximum values are 0; however, an error is returned when calling Atspi.Value.get_minimum_value(). Because this error does not occur when the steps are performed using WebKitGtk, I don't believe this is an AT-SPI2 bug.

https://rawgit.com/w3c/aria/master/aria/aria.html#scrollbar
https://rawgit.com/w3c/aria/master/aria/aria.html#slider
Summary: Implement support for implicit values for aria-value* attribute scrollbar and slider → Implement support for implicit values for aria-value* attributes for scrollbar and slider roles
This is something we should triage and fix but isn't among our most urgent bugs.(Contributions welcome as always!)
Priority: -- → P3
Mentor: jteh
Whiteboard: [lang=c++]

This will require changes to the MinValue, CurValue and MaxValue methods in Accessible; e.g.
https://searchfox.org/mozilla-central/source/accessible/generic/Accessible.cpp#1408
If the attribute value is NaN (IsNaN()), return the default. For CurValue, this will obviously require some calculation using the min and max values.
Add tests. We already have some aria-value* tests in accessible/tests/mochitests/events/test_valuechange.html, but we don't need to test events for this, so I think it makes sense to add a new test file in accessible/tests/mochitests/value, similar to test_range.html.

Type: defect → task

Hi! I would like to work on this issue.
I am unable to replicate this issue as the links in 1st comment are broken.
Can I get some help starting out?

Flags: needinfo?(jteh)

Thanks for your interest in working on this!

The data URLs in comment 0 will work if you enter them into your address bar; e.g. paste this into the address bar and press enter:

data:text/html,<div tabindex="0" role="slider" />

I'm not sure what platform you're testing on. I'm not familiar enough with Accerciser (on Linux) to give solid instructions. The Accessibility Inspector in Firefox exposes the current value, but not minimum or maximum. However, that should be enough to get you started. So, steps to reproduce might be as follows:

  1. Open this URL:
    data:text/html,<div tabindex="0" role="slider" />
  2. Right click on the document and select Inspect Accessibility Properties.
  3. In the accessibility tree, select the "slider".
  4. In the properties tree, examine the "value" property.
    • Expected: The value should be "50".
    • Actual: The value is "".
Flags: needinfo?(jteh)
Assignee: nobody → mislam
Status: NEW → ASSIGNED

As discussed, in addition to the changes outlined in comment 2, you'll need to modify Accessible::Value (the string value method) to call CurValue instead of fetching aria-valuenow directly:
https://searchfox.org/mozilla-central/rev/597a69c70a5cce6f42f159eb54ad1ef6745f5432/accessible/generic/Accessible.cpp#1371
Otherwise, where aria-valuenow is implicit, it'll just return the empty string because aria-valuenow isn't specified.
Of course, if CurValue returns IsNaN, you shouldn't output that.
You can use the AppendFloat method of the string.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7f1703036acf
Implement support for implicit values for aria-value* attributes for scrollbar and slider roles, r=Jamie
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7af553376576
Implement support for implicit values for aria-value* attributes for scrollbar and slider roles, r=Jamie
Flags: needinfo?(mislam)
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.