Closed Bug 1392926 Opened 7 years ago Closed 7 years ago

HTML5 section element role exposed incorrectly

Categories

(Firefox :: Disability Access, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: faulkner.steve, Assigned: MarcoZ)

Details

Attachments

(1 file)

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.
test case which includes named and un-named section element: https://s.codepen.io/stevef/debug/JyvZLN
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)
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)
Attached patch PatchSplinter Review
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)
Attachment #8900803 - Flags: review?(surkov.alexander) → review+
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)
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)
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
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
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: