Skip to content

Commit fd5b69b

Browse files
authored
Merge pull request #273 from A11yance/html-accessibility-api-mappings-1dot0
Refreshing HTML mappings according to the HTML Accessibility API Mapping
2 parents 647f330 + 22915be commit fd5b69b

File tree

10 files changed

+711
-3561
lines changed

10 files changed

+711
-3561
lines changed

__tests__/src/AXObjectElementMap-test.js

Lines changed: 131 additions & 708 deletions
Large diffs are not rendered by default.

__tests__/src/AXObjectRoleMap-test.js

Lines changed: 135 additions & 757 deletions
Large diffs are not rendered by default.

__tests__/src/AXObjectsMap-test.js

Lines changed: 189 additions & 1298 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

__tests__/src/elementAXObjectMap-test.js

Lines changed: 141 additions & 789 deletions
Large diffs are not rendered by default.

flow/axom.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,32 @@
22
* @flow
33
*/
44

5-
type AXObjectModelDefinition = {
5+
6+
7+
type AXObjectModelDefinition = {|
68
relatedConcepts: Array<AXObjectModelRelation>,
79
type: 'window' | 'structure' | 'widget' | 'generic',
8-
};
10+
|};
911

10-
type AXObjectModelRelation = {
12+
type AXObjectModelRelation = {|
1113
module?: 'HTML' | 'ARIA',
1214
concept?: AXObjectModelRelationConcept,
13-
};
15+
|};
1416

1517
/* The concept in a related domain that informs behavior mappings.
1618
* Related domains include: HTML and ARIA.
1719
*/
18-
type AXObjectModelRelationConcept = {
20+
type AXObjectModelRelationConcept = {|
1921
name?: string,
2022
attributes?: Array<AXObjectModelRelationConceptAttribute>,
21-
};
23+
constraints?: Array<
24+
| 'scoped to a details element'>,
25+
|};
2226

23-
type AXObjectModelRelationConceptAttribute = {
27+
type AXObjectModelRelationConceptAttribute = {|
2428
name: string,
2529
value?: string,
26-
};
30+
|};
2731

2832
type AXObjectName =
2933
'AbbrRole'
@@ -137,6 +141,7 @@ type AXObjectName =
137141
| 'TabListRole'
138142
| 'TabPanelRole'
139143
| 'TermRole'
144+
| 'TextAreaRole'
140145
| 'TextFieldRole'
141146
| 'TimeRole'
142147
| 'TimerRole'

scripts/axmodel.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,29 @@
390390
{
391391
"module": "HTML",
392392
"concept": {
393+
"attributes": [
394+
{
395+
"name": "open",
396+
"value": "open"
397+
}
398+
],
399+
"constraints": [
400+
"scoped to a details element"
401+
],
402+
"name": "summary"
403+
}
404+
},
405+
{
406+
"module": "HTML",
407+
"concept": {
408+
"attributes": [
409+
{
410+
"name": "aria-expanded"
411+
}
412+
],
413+
"constraints": [
414+
"scoped to a details element"
415+
],
393416
"name": "summary"
394417
}
395418
}
@@ -1351,6 +1374,29 @@
13511374
}
13521375
]
13531376
},
1377+
"TextAreaRole": {
1378+
"type": "widget",
1379+
"relatedConcepts": [
1380+
{
1381+
"module": "ARIA",
1382+
"concept": {
1383+
"attributes": [
1384+
{
1385+
"name": "aria-multiline",
1386+
"value": "true"
1387+
}
1388+
],
1389+
"name": "textbox"
1390+
}
1391+
},
1392+
{
1393+
"module": "HTML",
1394+
"concept": {
1395+
"name": "textarea"
1396+
}
1397+
}
1398+
]
1399+
},
13541400
"TextFieldRole": {
13551401
"type": "widget",
13561402
"relatedConcepts": [

src/AXObjectsMap.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ import TableRole from './etc/objects/TableRole';
114114
import TabListRole from './etc/objects/TabListRole';
115115
import TabPanelRole from './etc/objects/TabPanelRole';
116116
import TermRole from './etc/objects/TermRole';
117+
import TextAreaRole from './etc/objects/TextAreaRole';
117118
import TextFieldRole from './etc/objects/TextFieldRole';
118119
import TimeRole from './etc/objects/TimeRole';
119120
import TimerRole from './etc/objects/TimerRole';
@@ -242,6 +243,7 @@ const AXObjects: TAXObjects = [
242243
['TabListRole', TabListRole],
243244
['TabPanelRole', TabPanelRole],
244245
['TermRole', TermRole],
246+
['TextAreaRole', TextAreaRole],
245247
['TextFieldRole', TextFieldRole],
246248
['TimeRole', TimeRole],
247249
['TimerRole', TimerRole],

src/elementAXObjectMap.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ const elementAXObjectMap: TAXObjectQueryMap<
6565
}
6666
},
6767
get: function (key: AXObjectModelRelationConcept): ?Array<AXObjectName> {
68-
const item = elementAXObjects.find(tuple => (deepEqual(key, tuple[0])) ? true : false);
68+
const item = elementAXObjects.find(tuple => (
69+
key.name === tuple[0].name && deepEqual(key.attributes, tuple[0].attributes)
70+
));
6971
return item && item[1];
7072
},
7173
has: function (key: AXObjectModelRelationConcept): boolean {

src/etc/objects/DisclosureTriangleRole.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ const DisclosureTriangleRole: AXObjectModelDefinition = {
66
{
77
module: 'HTML',
88
concept: {
9+
attributes: [
10+
{
11+
name: 'open',
12+
value: 'open',
13+
},
14+
],
15+
constraints: [
16+
'scoped to a details element',
17+
],
18+
name: 'summary',
19+
},
20+
},
21+
{
22+
module: 'HTML',
23+
concept: {
24+
attributes: [
25+
{
26+
name: 'aria-expanded',
27+
},
28+
],
29+
constraints: [
30+
'scoped to a details element',
31+
],
932
name: 'summary',
1033
},
1134
},

src/etc/objects/TextAreaRole.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @flow
3+
*/
4+
const TextAreaRole: AXObjectModelDefinition = {
5+
relatedConcepts: [
6+
{
7+
module: 'ARIA',
8+
concept: {
9+
attributes: [
10+
{
11+
name: 'aria-multiline',
12+
value: 'true',
13+
},
14+
],
15+
name: 'textbox',
16+
},
17+
},
18+
{
19+
module: 'HTML',
20+
concept: {
21+
name: 'textarea',
22+
},
23+
},
24+
],
25+
type: 'widget',
26+
};
27+
28+
export default TextAreaRole;

0 commit comments

Comments
 (0)