Closed Bug 1418102 Opened 3 years ago Closed 3 years ago

Objects of role heading need to have a name computed from their subtree

Categories

(Core :: Disability Access APIs, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox59 --- fixed

People

(Reporter: aaronlev, Assigned: surkov)

References

Details

Attachments

(2 files)

In the ARIA spec, a heading is defined as getting it's name from author or subtree. However, headings are not getting a name unless the author specifically defines it. The ARIA spec info for heading is here:
https://www.w3.org/TR/wai-aria-1.1/#heading

Luckily, this is a one line change! :)
The entry in the role map file needs to be changed from   eNameFromSubtreeIfReqRule to eNameFromSubtreeRule on the following line:
https://dxr.mozilla.org/mozilla-central/source/accessible/base/RoleMap.h?q=file%3Arolemap&redirect_type=single#
While we're at it (I keep forgetting to file a bug about this), headings really should not inherit their name from the title attribute if they have content. Right now, this:
data:text/html,<h1 title="foo">bar</h1>
results in the heading getting a name of "foo", which is totally undesirable; the title is supplementary information which should get mapped to the description.

This is causing problems for real world cases such as MSDN and the Canvas LMS. See this NVDA issue:
https://github.com/nvaccess/nvda/issues/7033

I suspect changing the rule as Aaron suggests should fix this, since the name will come from the subtree instead, but I'm not 100% certain.
(In reply to James Teh [:Jamie] from comment #1)
> I suspect changing the rule as Aaron suggests should fix this, since the
> name will come from the subtree instead, but I'm not 100% certain.

I think it should.
Assignee: nobody → surkov.alexander
Attachment #8929444 - Flags: review?(mzehe)
Comment on attachment 8929444 [details] [diff] [review]
Aaron's patch materialization

r=me, thanks. Out of curiosity, do you remember the history of how using the eNameFromSubtreeIfReqRule came about originally? I guess if no tests break, this means it was never relevant, so... But still curious.
Attachment #8929444 - Flags: review?(mzehe) → review+
(In reply to Marco Zehe (:MarcoZ) from comment #4)
> Comment on attachment 8929444 [details] [diff] [review]
> Aaron's patch materialization
> 
> r=me, thanks. Out of curiosity, do you remember the history of how using the
> eNameFromSubtreeIfReqRule came about originally? I guess if no tests break,
> this means it was never relevant, so... But still curious.

I think that was a common rule for all text containers like HTML:p and others.
https://hg.mozilla.org/integration/mozilla-inbound/rev/dbff505c9c0543b570f4142ff5664cacb625d0b1
Bug 1418102 - role heading need to have a name computed from its subtree, r=marcoz
Attached patch 1418102 test fixSplinter Review
Attachment #8930123 - Flags: review?(surkov.alexander)
Comment on attachment 8930123 [details] [diff] [review]
1418102 test fix

Review of attachment 8930123 [details] [diff] [review]:
-----------------------------------------------------------------

r=me to the best of my knowledge of jsat tests, they are complicated
Attachment #8930123 - Flags: review?(surkov.alexander) → review+
Pushed by yura.zenevich@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ad911d3cc87c
fixed jsat addName method when name is an empty string. Updated tests. r=surkov
https://hg.mozilla.org/mozilla-central/rev/dbff505c9c05
https://hg.mozilla.org/mozilla-central/rev/ad911d3cc87c
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
See Also: → 1422913
You need to log in before you can comment on or make changes to this bug.