Closed Bug 1357100 Opened 3 years ago Closed 4 months ago

Implement support for implicit value for aria-level on heading role

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jdiggs, Assigned: gvelchuru, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=c++])

Attachments

(1 file)

In ARIA 1.1, the implicit value for aria-level on a heading is "2". See https://rawgit.com/w3c/aria/master/aria/aria.html#heading.

Steps to reproduce:
1. Load data:text/html,<div role="heading">foo</div>
2. Use Accerciser to examine the element

Expected result: "level:2" would be found in the accessible object attributes.

Actual result: "level:2" is not found in the accessible object attributes.
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++]

Thoughts on fixing this:

  1. The code should probably go here, just before we call GetDefaultLevel: https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/accessible/base/nsAccUtils.cpp#90
  2. We only want to do this if we're dealing with an ARIA role="heading". Get the ARIA role map entry and check if it's a heading. Example: https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/accessible/generic/Accessible.cpp#990
  3. If so, return the implicit value: 2.
  4. Add a test, similar to those for HTML headings (but based on the test in comment 0): https://searchfox.org/mozilla-central/rev/227f5329f75bd8b16c6b146a7414598a420260cb/accessible/tests/mochitest/attributes/test_obj_group.html#213
Type: defect → task

Currently taking a look at this!

I've uploaded a PR, im still unsure how exactly to test so some pointers would be fantastic

Flags: needinfo?(jteh)

Thanks for working on this! I'll add some comments to the patch, but here are some more precise steps to reproduce:

  1. Paste this URL into the address bar and press enter:
    data:text/html,<div role="heading">foo</div>
  2. Right click on "foo" and choose "Inspect Accessibility Properties".
  3. In the properties tree, expand the "attributes".
    • Expected: There should be a level: "2" attribute.
    • Actual: There is no level attribute.
Flags: needinfo?(jteh)

I made the changes, but somehow I am still not passing the test -- am I missing something?

Flags: needinfo?(jteh)

Ug. Turns out I was incorrect about where to place this code. Sorry. :( I'll comment on the patch.

Flags: needinfo?(jteh)
Assignee: nobody → gvelchuru
Status: NEW → ASSIGNED
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/54d0977adb44
change implicit val for aria-level on a heading to 2 r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.