HTML5 section element role exposed incorrectly

RESOLVED FIXED in Firefox 57

Status

()

Firefox
Disability Access
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: steve faulkner, Assigned: MarcoZ)

Tracking

unspecified
Firefox 57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 months ago
The HTML Accessibility API Mappings 1.0 defines different roles for the section element depending on the presence of an accessible name:

with accessible name role=region
https://w3c.github.io/html-aam/#el-section
http://w3c.github.io/aria/core-aam/core-aam.html#role-map-region
without, does not = region
http://w3c.github.io/aria/core-aam/core-aam.html#role-map-region-nameless

suggest firefox align implementation with spec.
(Reporter)

Comment 1

8 months ago
test case which includes named and un-named section element: https://s.codepen.io/stevef/debug/JyvZLN
(Assignee)

Comment 2

8 months ago
Steve, which version of Firefox did you test this with? In the testcase, NVDA announces the named section as a region, and I believe Joanie fixed this for Firefox recently. I am on Nightly 57, and I believe the fix landed in 56, which is currently in beta. I cannot reproduce the problem with your testcase, it is exposed as a region for me when named.
Flags: needinfo?(faulkner.steve)
(Assignee)

Comment 3

8 months ago
OK, forget comment #2. I now know what the bug is. We *are* exposing xml-role "region" on unnamed sections when we shouldn't.
Flags: needinfo?(faulkner.steve)
(Assignee)

Comment 4

8 months ago
Created attachment 8900803 [details] [diff] [review]
Patch

Making sure that we are not giving <section> elements an XML-role "region" object attribute any more if the section hasn't been named. Test included.
Assignee: nobody → mzehe
Status: NEW → ASSIGNED
Attachment #8900803 - Flags: review?(surkov.alexander)

Updated

8 months ago
Attachment #8900803 - Flags: review?(surkov.alexander) → review+
(Assignee)

Comment 5

8 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/c216b1ee565e736235b57e60c0754331af3f20e0
Bug 1392926 - Only expose the Region landmark role if a section element has been explicitly named by the author, r=surkov
Backed out for failing a11y's accessible/tests/mochitest/attributes/test_xml-roles.html and accessible/tests/mochitest/jsat/test_traversal_helper.html:

https://hg.mozilla.org/integration/mozilla-inbound/rev/e7a9f2e39a778829269ca4105ebe808ba038f2cd

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=c216b1ee565e736235b57e60c0754331af3f20e0&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=125901621&repo=mozilla-inbound

[task 2017-08-25T13:14:20.141975Z] 13:14:20     INFO - TEST-PASS | accessible/tests/mochitest/attributes/test_xml-roles.html | There is an unexpected attribute 'xml-roles'  for  'section_footer'  
[task 2017-08-25T13:14:20.142747Z] 13:14:20     INFO - TEST-PASS | accessible/tests/mochitest/attributes/test_xml-roles.html | Attribute 'xml-roles' has wrong value for  'aside'  
[task 2017-08-25T13:14:20.143523Z] 13:14:20     INFO - Buffered messages finished
[task 2017-08-25T13:14:20.144455Z] 13:14:20     INFO - TEST-UNEXPECTED-FAIL | accessible/tests/mochitest/attributes/test_xml-roles.html | There is no expected attribute 'xml-roles'  for  'section'  
[task 2017-08-25T13:14:20.146042Z] 13:14:20     INFO - compareAttrs@chrome://mochitests/content/a11y/accessible/tests/mochitest/attributes.js:349:7
[task 2017-08-25T13:14:20.147084Z] 13:14:20     INFO - testAttrsInternal@chrome://mochitests/content/a11y/accessible/tests/mochitest/attributes.js:316:3
[task 2017-08-25T13:14:20.148001Z] 13:14:20     INFO - testAttrs@chrome://mochitests/content/a11y/accessible/tests/mochitest/attributes.js:14:3
[task 2017-08-25T13:14:20.149345Z] 13:14:20     INFO - doTest@chrome://mochitests/content/a11y/accessible/tests/mochitest/attributes/test_xml-roles.html:30:7
[task 2017-08-25T13:14:20.150160Z] 13:14:20     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:676:12
[task 2017-08-25T13:14:20.151065Z] 13:14:20     INFO - waitForDocLoad/<@chrome://mochitests/content/a11y/accessible/tests/mochitest/common.js:165:9
[task 2017-08-25T13:14:20.152450Z] 13:14:20     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:676:12
[task 2017-08-25T13:14:20.153312Z] 13:14:20     INFO - waitForDocLoad@chrome://mochitests/content/a11y/accessible/tests/mochitest/common.js:156:5
[task 2017-08-25T13:14:20.154073Z] 13:14:20     INFO - focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59

[task 2017-08-25T13:16:11.544889Z] 13:16:11     INFO - TEST-PASS | accessible/tests/mochitest/jsat/test_traversal_helper.html | expected 'heading-5', got ['h6@id="heading-5" node', address: [object HTMLHeadingElement], role: heading, address: [xpconnect wrapped nsIAccessible]]. landed on correct accessible 
[task 2017-08-25T13:16:11.545470Z] 13:16:11     INFO - TEST-PASS | accessible/tests/mochitest/jsat/test_traversal_helper.html | successfully did moveNext with Section 
[task 2017-08-25T13:16:11.546028Z] 13:16:11     INFO - Buffered messages finished
[task 2017-08-25T13:16:11.546730Z] 13:16:11     INFO - TEST-UNEXPECTED-FAIL | accessible/tests/mochitest/jsat/test_traversal_helper.html | expected 'link-1', got ['div@id="statusbar-1" node', address: [object HTMLDivElement], role: statusbar, address: [xpconnect wrapped nsIAccessible]]. landed on correct accessible 
[task 2017-08-25T13:16:11.547162Z] 13:16:11     INFO - accessibleIs@chrome://mochitests/content/a11y/accessible/tests/mochitest/jsat/test_traversal_helper.html:32:9
[task 2017-08-25T13:16:11.547617Z] 13:16:11     INFO - walkSequence@chrome://mochitests/content/a11y/accessible/tests/mochitest/jsat/test_traversal_helper.html:42:9
[task 2017-08-25T13:16:11.548347Z] 13:16:11     INFO - testTraversalHelper@chrome://mochitests/content/a11y/accessible/tests/mochitest/jsat/test_traversal_helper.html:49:7
[task 2017-08-25T13:16:11.548893Z] 13:16:11     INFO - doTest@chrome://mochitests/content/a11y/accessible/tests/mochitest/jsat/test_traversal_helper.html:85:7
[task 2017-08-25T13:16:11.549489Z] 13:16:11     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:676:12
[task 2017-08-25T13:16:11.550085Z] 13:16:11     INFO - waitForDocLoad/<@chrome://mochitests/content/a11y/accessible/tests/mochitest/common.js:165:9
[task 2017-08-25T13:16:11.551584Z] 13:16:11     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:676:12
[task 2017-08-25T13:16:11.552144Z] 13:16:11     INFO - waitForDocLoad@chrome://mochitests/content/a11y/accessible/tests/mochitest/common.js:156:5
[task 2017-08-25T13:16:11.552759Z] 13:16:11     INFO - focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59
[task 2017-08-25T13:16:11.553474Z] 13:16:11     INFO - Not taking screenshot here: see the one that was previously logged
Flags: needinfo?(mzehe)
(Assignee)

Comment 7

8 months ago
OK, I've easily fixed the first failure, but this second one baffles me. Why would our traversal skip over the link and move directly to the status bar? Eitan, do you have any ideas?

(In reply to Sebastian Hengst [:aryx][:archaeopteryx] (needinfo on intermittent or backout) from comment #6)
> [task 2017-08-25T13:16:11.544889Z] 13:16:11     INFO - TEST-PASS |
> accessible/tests/mochitest/jsat/test_traversal_helper.html | expected
> 'heading-5', got ['h6@id="heading-5" node', address: [object
> HTMLHeadingElement], role: heading, address: [xpconnect wrapped
> nsIAccessible]]. landed on correct accessible 
> [task 2017-08-25T13:16:11.545470Z] 13:16:11     INFO - TEST-PASS |
> accessible/tests/mochitest/jsat/test_traversal_helper.html | successfully
> did moveNext with Section 
> [task 2017-08-25T13:16:11.546028Z] 13:16:11     INFO - Buffered messages
> finished
> [task 2017-08-25T13:16:11.546730Z] 13:16:11     INFO - TEST-UNEXPECTED-FAIL
> | accessible/tests/mochitest/jsat/test_traversal_helper.html | expected
> 'link-1', got ['div@id="statusbar-1" node', address: [object
> HTMLDivElement], role: statusbar, address: [xpconnect wrapped
> nsIAccessible]]. landed on correct accessible 
> [task 2017-08-25T13:16:11.547162Z] 13:16:11     INFO -
> accessibleIs@chrome://mochitests/content/a11y/accessible/tests/mochitest/
> jsat/test_traversal_helper.html:32:9
> [task 2017-08-25T13:16:11.547617Z] 13:16:11     INFO -
> walkSequence@chrome://mochitests/content/a11y/accessible/tests/mochitest/
> jsat/test_traversal_helper.html:42:9
> [task 2017-08-25T13:16:11.548347Z] 13:16:11     INFO -
> testTraversalHelper@chrome://mochitests/content/a11y/accessible/tests/
> mochitest/jsat/test_traversal_helper.html:49:7
> [task 2017-08-25T13:16:11.548893Z] 13:16:11     INFO -
> doTest@chrome://mochitests/content/a11y/accessible/tests/mochitest/jsat/
> test_traversal_helper.html:85:7
> [task 2017-08-25T13:16:11.549489Z] 13:16:11     INFO - setTimeout
> handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/
> SimpleTest.js:676:12
> [task 2017-08-25T13:16:11.550085Z] 13:16:11     INFO -
> waitForDocLoad/<@chrome://mochitests/content/a11y/accessible/tests/mochitest/
> common.js:165:9
> [task 2017-08-25T13:16:11.551584Z] 13:16:11     INFO - setTimeout
> handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/
> SimpleTest.js:676:12
> [task 2017-08-25T13:16:11.552144Z] 13:16:11     INFO -
> waitForDocLoad@chrome://mochitests/content/a11y/accessible/tests/mochitest/
> common.js:156:5
> [task 2017-08-25T13:16:11.552759Z] 13:16:11     INFO -
> focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:
> 795:59
> [task 2017-08-25T13:16:11.553474Z] 13:16:11     INFO - Not taking screenshot
> here: see the one that was previously logged
Flags: needinfo?(mzehe) → needinfo?(eitan)
That rule jumps between headers on a page, or the first element of a region.

Because the link is now in a bare section that doesn't get a "region" xml-role, it is skipped. You can fix this in two ways:

1. Add an aria-label to the section parent of link-1.
2. Remove "link-1" from the traversal order.

I would lean towards 1.
Flags: needinfo?(eitan)

Comment 9

8 months ago
Pushed by mzehe@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4b4b2af957d4
Only expose the Region landmark role if a section element has been explicitly named by the author, r=surkov
(Assignee)

Comment 10

8 months ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/4b4b2af957d43556ac7755206ebed521d14a8a33
Bug 1392926 - Only expose the Region landmark role if a section element has been explicitly named by the author, r=surkov
https://hg.mozilla.org/mozilla-central/rev/4b4b2af957d4
Status: ASSIGNED → RESOLVED
Last Resolved: 8 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
You need to log in before you can comment on or make changes to this bug.