Skip to content

Commit e559ead

Browse files
feat: update role states and properties
* Addition of `aria-braillelabel` * Addition of `aria-brailleroledescription` * Addition of `aria-description` * Fixes to some `prohibitedProps` and `nameFrom` fields
1 parent 3bf433e commit e559ead

29 files changed

+549
-79
lines changed

__tests__/src/elementRoleMap-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ const entriesList = [
7272
[{"name": "h4"}, ["heading"]],
7373
[{"name": "h5"}, ["heading"]],
7474
[{"name": "h6"}, ["heading"]],
75-
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["img"]],
76-
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["img"]],
75+
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["image", "img"]],
76+
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["image", "img"]],
7777
[{"name": "ins"}, ["insertion"]],
7878
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, ["link"]],
7979
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}, ["link"]],
@@ -90,9 +90,9 @@ const entriesList = [
9090
[{"name": "math"}, ["math"]],
9191
[{"name": "meter"}, ["meter"]],
9292
[{"name": "nav"}, ["navigation"]],
93+
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["none", "presentation"]],
9394
[{"name": "option"}, ["option"]],
9495
[{"name": "p"}, ["paragraph"]],
95-
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["presentation"]],
9696
[{"name": "progress"}, ["progressbar"]],
9797
[{"attributes": [{"name": "aria-valuemax"}, {"name": "aria-valuemin", "value": 0}, {"name": "aria-valuenow"}], "constraints": ["the progress bar is determinate"],"name": "progress"}, ["progressbar"]],
9898
[{"attributes": [{"name": "type", "value": "radio"}], "name": "input"}, ["radio"]],

__tests__/src/roleElementMap-test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const entriesList = [
3333
["gridcell", [{"constraints": ["ancestor table element has grid role", "ancestor table element has treegrid role"], "name": "td"}]],
3434
["group", [{"name": "details"}, {"name": "fieldset"}, {"name": "optgroup"}, {"name": "address"}]],
3535
["heading", [{"name": "h1"}, {"name": "h2"}, {"name": "h3"}, {"name": "h4"}, {"name": "h5"}, {"name": "h6"}]],
36+
["image", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
3637
["img", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
3738
["insertion", [{"name": "ins"}]],
3839
["link", [{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, {"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}]],
@@ -44,6 +45,7 @@ const entriesList = [
4445
["math", [{"name": "math"}]],
4546
["meter", [{"name": "meter"}]],
4647
["navigation", [{"name": "nav"}]],
48+
["none", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
4749
["option", [{"name": "option"}]],
4850
["paragraph", [{"name": "p"}]],
4951
["presentation", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
@@ -72,7 +74,7 @@ const entriesList = [
7274
test('roleElementMap API', (t) => {
7375
const predicate = (role, [r]) => role === r;
7476

75-
testIteration(t, roleElementMap, entriesList, 55, predicate);
77+
testIteration(t, roleElementMap, entriesList, 57, predicate);
7678

7779
testForEach(t, roleElementMap, entriesList, predicate);
7880

__tests__/src/rolesMap-test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const entriesList = [
2020
["code", null],
2121
["columnheader", null],
2222
["combobox", null],
23+
["comment", null],
2324
["command", null],
2425
["complementary", null],
2526
["composite", null],
@@ -38,6 +39,7 @@ const entriesList = [
3839
["gridcell", null],
3940
["group", null],
4041
["heading", null],
42+
["image", null],
4143
["img", null],
4244
["input", null],
4345
["insertion", null],
@@ -85,6 +87,7 @@ const entriesList = [
8587
["strong", null],
8688
["structure", null],
8789
["subscript", null],
90+
["suggestion", null],
8891
["superscript", null],
8992
["switch", null],
9093
["tab", null],
@@ -151,7 +154,7 @@ const entriesList = [
151154
test('rolesMap API', (t) => {
152155
const predicate = (role, [r]) => role === r;
153156

154-
testIteration(t, rolesMap, entriesList, 139, predicate);
157+
testIteration(t, rolesMap, entriesList, 142, predicate);
155158

156159
testForEach(t, rolesMap, entriesList, predicate);
157160

flow/aria.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ type ARIADocumentStructureRole =
5555
| 'blockquote'
5656
| 'caption'
5757
| 'cell'
58+
| 'comment'
5859
| 'columnheader'
5960
| 'definition'
6061
| 'deletion'
@@ -66,6 +67,7 @@ type ARIADocumentStructureRole =
6667
| 'generic'
6768
| 'group'
6869
| 'heading'
70+
| 'image'
6971
| 'img'
7072
| 'insertion'
7173
| 'list'
@@ -83,6 +85,7 @@ type ARIADocumentStructureRole =
8385
| 'separator'
8486
| 'strong'
8587
| 'subscript'
88+
| 'suggestion'
8689
| 'superscript'
8790
| 'table'
8891
| 'term'

0 commit comments

Comments
 (0)