Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
839 changes: 131 additions & 708 deletions __tests__/src/AXObjectElementMap-test.js

Large diffs are not rendered by default.

892 changes: 135 additions & 757 deletions __tests__/src/AXObjectRoleMap-test.js

Large diffs are not rendered by default.

1,487 changes: 189 additions & 1,298 deletions __tests__/src/AXObjectsMap-test.js

Large diffs are not rendered by default.

930 changes: 141 additions & 789 deletions __tests__/src/elementAXObjectMap-test.js

Large diffs are not rendered by default.

21 changes: 13 additions & 8 deletions flow/axom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@
* @flow
*/

type AXObjectModelDefinition = {


type AXObjectModelDefinition = {|
relatedConcepts: Array<AXObjectModelRelation>,
type: 'window' | 'structure' | 'widget' | 'generic',
};
|};

type AXObjectModelRelation = {
type AXObjectModelRelation = {|
module?: 'HTML' | 'ARIA',
concept?: AXObjectModelRelationConcept,
};
|};

/* The concept in a related domain that informs behavior mappings.
* Related domains include: HTML and ARIA.
*/
type AXObjectModelRelationConcept = {
type AXObjectModelRelationConcept = {|
name?: string,
attributes?: Array<AXObjectModelRelationConceptAttribute>,
};
constraints?: Array<
| 'scoped to a details element'>,
|};

type AXObjectModelRelationConceptAttribute = {
type AXObjectModelRelationConceptAttribute = {|
name: string,
value?: string,
};
|};

type AXObjectName =
'AbbrRole'
Expand Down Expand Up @@ -137,6 +141,7 @@ type AXObjectName =
| 'TabListRole'
| 'TabPanelRole'
| 'TermRole'
| 'TextAreaRole'
| 'TextFieldRole'
| 'TimeRole'
| 'TimerRole'
Expand Down
46 changes: 46 additions & 0 deletions scripts/axmodel.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,29 @@
{
"module": "HTML",
"concept": {
"attributes": [
{
"name": "open",
"value": "open"
}
],
"constraints": [
"scoped to a details element"
],
"name": "summary"
}
},
{
"module": "HTML",
"concept": {
"attributes": [
{
"name": "aria-expanded"
}
],
"constraints": [
"scoped to a details element"
],
"name": "summary"
}
}
Expand Down Expand Up @@ -1351,6 +1374,29 @@
}
]
},
"TextAreaRole": {
"type": "widget",
"relatedConcepts": [
{
"module": "ARIA",
"concept": {
"attributes": [
{
"name": "aria-multiline",
"value": "true"
}
],
"name": "textbox"
}
},
{
"module": "HTML",
"concept": {
"name": "textarea"
}
}
]
},
"TextFieldRole": {
"type": "widget",
"relatedConcepts": [
Expand Down
2 changes: 2 additions & 0 deletions src/AXObjectsMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ import TableRole from './etc/objects/TableRole';
import TabListRole from './etc/objects/TabListRole';
import TabPanelRole from './etc/objects/TabPanelRole';
import TermRole from './etc/objects/TermRole';
import TextAreaRole from './etc/objects/TextAreaRole';
import TextFieldRole from './etc/objects/TextFieldRole';
import TimeRole from './etc/objects/TimeRole';
import TimerRole from './etc/objects/TimerRole';
Expand Down Expand Up @@ -242,6 +243,7 @@ const AXObjects: TAXObjects = [
['TabListRole', TabListRole],
['TabPanelRole', TabPanelRole],
['TermRole', TermRole],
['TextAreaRole', TextAreaRole],
['TextFieldRole', TextFieldRole],
['TimeRole', TimeRole],
['TimerRole', TimerRole],
Expand Down
4 changes: 3 additions & 1 deletion src/elementAXObjectMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ const elementAXObjectMap: TAXObjectQueryMap<
}
},
get: function (key: AXObjectModelRelationConcept): ?Array<AXObjectName> {
const item = elementAXObjects.find(tuple => (deepEqual(key, tuple[0])) ? true : false);
const item = elementAXObjects.find(tuple => (
key.name === tuple[0].name && deepEqual(key.attributes, tuple[0].attributes)
));
return item && item[1];
},
has: function (key: AXObjectModelRelationConcept): boolean {
Expand Down
23 changes: 23 additions & 0 deletions src/etc/objects/DisclosureTriangleRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,29 @@ const DisclosureTriangleRole: AXObjectModelDefinition = {
{
module: 'HTML',
concept: {
attributes: [
{
name: 'open',
value: 'open',
},
],
constraints: [
'scoped to a details element',
],
name: 'summary',
},
},
{
module: 'HTML',
concept: {
attributes: [
{
name: 'aria-expanded',
},
],
constraints: [
'scoped to a details element',
],
name: 'summary',
},
},
Expand Down
28 changes: 28 additions & 0 deletions src/etc/objects/TextAreaRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @flow
*/
const TextAreaRole: AXObjectModelDefinition = {
relatedConcepts: [
{
module: 'ARIA',
concept: {
attributes: [
{
name: 'aria-multiline',
value: 'true',
},
],
name: 'textbox',
},
},
{
module: 'HTML',
concept: {
name: 'textarea',
},
},
],
type: 'widget',
};

export default TextAreaRole;