Skip to content

Commit 2085d0f

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 18110d3 commit 2085d0f

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
@@ -66,8 +66,8 @@ const entriesList = [
6666
[{"name": "h4"}, ["heading"]],
6767
[{"name": "h5"}, ["heading"]],
6868
[{"name": "h6"}, ["heading"]],
69-
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["img"]],
70-
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["img"]],
69+
[{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, ["image", "img"]],
70+
[{"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}, ["image", "img"]],
7171
[{"name": "ins"}, ["insertion"]],
7272
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, ["link"]],
7373
[{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}, ["link"]],
@@ -84,9 +84,9 @@ const entriesList = [
8484
[{"name": "math"}, ["math"]],
8585
[{"name": "meter"}, ["meter"]],
8686
[{"name": "nav"}, ["navigation"]],
87+
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["none", "presentation"]],
8788
[{"name": "option"}, ["option"]],
8889
[{"name": "p"}, ["paragraph"]],
89-
[{"attributes": [{"name": "alt", "value": ""}], "name": "img"}, ["presentation"]],
9090
[{"name": "progress"}, ["progressbar"]],
9191
[{"attributes": [{"name": "aria-valuemax"}, {"name": "aria-valuemin", "value": 0}, {"name": "aria-valuenow"}], "constraints": ["the progress bar is determinate"],"name": "progress"}, ["progressbar"]],
9292
[{"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
@@ -26,6 +26,7 @@ const entriesList = [
2626
["gridcell", [{"constraints": ["ancestor table element has grid role", "ancestor table element has treegrid role"], "name": "td"}]],
2727
["group", [{"name": "details"}, {"name": "fieldset"}, {"name": "optgroup"}, {"name": "address"}]],
2828
["heading", [{"name": "h1"}, {"name": "h2"}, {"name": "h3"}, {"name": "h4"}, {"name": "h5"}, {"name": "h6"}]],
29+
["image", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
2930
["img", [{"attributes": [{"constraints": ["set"], "name": "alt"}], "name": "img"}, {"attributes": [{"constraints": ["undefined"], "name": "alt"}], "name": "img"}]],
3031
["insertion", [{"name": "ins"}]],
3132
["link", [{"attributes": [{"constraints": ["set"], "name": "href"}], "name": "a"}, {"attributes": [{"constraints": ["set"], "name": "href"}], "name": "area"}]],
@@ -37,6 +38,7 @@ const entriesList = [
3738
["math", [{"name": "math"}]],
3839
["meter", [{"name": "meter"}]],
3940
["navigation", [{"name": "nav"}]],
41+
["none", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
4042
["option", [{"name": "option"}]],
4143
["paragraph", [{"name": "p"}]],
4244
["presentation", [{"attributes": [{"name": "alt", "value": ""}], "name": "img"}]],
@@ -146,7 +148,7 @@ describe('roleElementMap', function () {
146148
});
147149
describe('spread operator', function () {
148150
it('should have a specific length', function () {
149-
expect([...roleElementMap].length).toEqual(55);
151+
expect([...roleElementMap].length).toEqual(57);
150152
});
151153
test.each([...roleElementMap])('Testing element: %o', (obj, roles) => {
152154
expect(entriesList).toEqual(

__tests__/src/rolesMap-test.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const entriesList = [
1616
["code", expect.any(Object)],
1717
["columnheader", expect.any(Object)],
1818
["combobox", expect.any(Object)],
19+
["comment", expect.any(Object)],
1920
["command", expect.any(Object)],
2021
["complementary", expect.any(Object)],
2122
["composite", expect.any(Object)],
@@ -34,6 +35,7 @@ const entriesList = [
3435
["gridcell", expect.any(Object)],
3536
["group", expect.any(Object)],
3637
["heading", expect.any(Object)],
38+
["image", expect.any(Object)],
3739
["img", expect.any(Object)],
3840
["input", expect.any(Object)],
3941
["insertion", expect.any(Object)],
@@ -81,6 +83,7 @@ const entriesList = [
8183
["strong", expect.any(Object)],
8284
["structure", expect.any(Object)],
8385
["subscript", expect.any(Object)],
86+
["suggestion", expect.any(Object)],
8487
["superscript", expect.any(Object)],
8588
["switch", expect.any(Object)],
8689
["tab", expect.any(Object)],
@@ -220,7 +223,7 @@ describe('rolesMap', function () {
220223
});
221224
describe('spread operator', function () {
222225
it('should have a specific length', function () {
223-
expect([...rolesMap].length).toEqual(139);
226+
expect([...rolesMap].length).toEqual(142);
224227
});
225228
test.each([...rolesMap])('Testing element: %o', (obj, roles) => {
226229
expect(entriesList).toEqual(

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)