Skip to content

Commit

Permalink
feat: update role states and properties
Browse files Browse the repository at this point in the history
* Addition of `aria-braillelabel`
* Addition of `aria-brailleroledescription`
* Addition of `aria-description`
* Fixes to some `prohibitedProps` and `nameFrom` fields
  • Loading branch information
jlp-craigmorten authored and ljharb committed Sep 23, 2024
1 parent dfcb8ca commit 7ba68c1
Show file tree
Hide file tree
Showing 29 changed files with 548 additions and 78 deletions.
6 changes: 3 additions & 3 deletions __tests__/src/elementRoleMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ const entriesList = [
[{"name": "h4"}, ["heading"]],
[{"name": "h5"}, ["heading"]],
[{"name": "h6"}, ["heading"]],
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["img"]],
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["img"]],
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["image", "img"]],
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["image", "img"]],
[{"name": "ins"}, ["insertion"]],
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, ["link"]],
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}, ["link"]],
Expand All @@ -92,9 +92,9 @@ const entriesList = [
[{"name": "math"}, ["math"]],
[{"name": "meter"}, ["meter"]],
[{"name": "nav"}, ["navigation"]],
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["none", "presentation"]],
[{"name": "option"}, ["option"]],
[{"name": "p"}, ["paragraph"]],
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["presentation"]],
[{"name": "progress"}, ["progressbar"]],
[{"attributes": [{"name": "aria-valuemax"}, {"name": "aria-valuemin", "value": 0}, {"name": "aria-valuenow"}], "constraints": ["the progress bar is determinate"],"name": "progress"}, ["progressbar"]],
[{"attributes": [{"name": "type", "value": "radio"}], "name": "input"}, ["radio"]],
Expand Down
2 changes: 2 additions & 0 deletions __tests__/src/roleElementMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const entriesList = [
["gridcell", [{"constraints": ["ancestor table element has grid role", "ancestor table element has treegrid role"], "name": "td"}]],
["group", [{"name": "address"}, {"name": "details"}, {"name": "fieldset"}, {"name": "hgroup"}, {"name": "optgroup"}]],
["heading", [{"name": "h1"}, {"name": "h2"}, {"name": "h3"}, {"name": "h4"}, {"name": "h5"}, {"name": "h6"}]],
["image", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
["img", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
["insertion", [{"name": "ins"}]],
["link", [{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, {"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}]],
Expand All @@ -44,6 +45,7 @@ const entriesList = [
["math", [{"name": "math"}]],
["meter", [{"name": "meter"}]],
["navigation", [{"name": "nav"}]],
["none", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
["option", [{"name": "option"}]],
["paragraph", [{"name": "p"}]],
["presentation", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
Expand Down
5 changes: 4 additions & 1 deletion __tests__/src/rolesMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const entriesList = [
["code", null],
["columnheader", null],
["combobox", null],
["comment", null],
["command", null],
["complementary", null],
["composite", null],
Expand All @@ -38,6 +39,7 @@ const entriesList = [
["gridcell", null],
["group", null],
["heading", null],
["image", null],
["img", null],
["input", null],
["insertion", null],
Expand Down Expand Up @@ -85,6 +87,7 @@ const entriesList = [
["strong", null],
["structure", null],
["subscript", null],
["suggestion", null],
["superscript", null],
["switch", null],
["tab", null],
Expand Down Expand Up @@ -151,7 +154,7 @@ const entriesList = [
test('rolesMap API', (t) => {
const predicate = (role, [r]) => role === r;

testIteration(t, rolesMap, entriesList, 139, predicate);
testIteration(t, rolesMap, entriesList, 142, predicate);

testForEach(t, rolesMap, entriesList, predicate);

Expand Down
3 changes: 3 additions & 0 deletions flow/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type ARIADocumentStructureRole =
| 'blockquote'
| 'caption'
| 'cell'
| 'comment'
| 'columnheader'
| 'definition'
| 'deletion'
Expand All @@ -66,6 +67,7 @@ type ARIADocumentStructureRole =
| 'generic'
| 'group'
| 'heading'
| 'image'
| 'img'
| 'insertion'
| 'list'
Expand All @@ -83,6 +85,7 @@ type ARIADocumentStructureRole =
| 'separator'
| 'strong'
| 'subscript'
| 'suggestion'
| 'superscript'
| 'table'
| 'term'
Expand Down
Loading

0 comments on commit 7ba68c1

Please sign in to comment.