Skip to content

Commit

Permalink
Fix mapping for the HTML select element
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebeach committed Nov 26, 2019
1 parent 900cfd9 commit c3c510d
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 3 deletions.
5 changes: 4 additions & 1 deletion flow/aria.js
Expand Up @@ -312,5 +312,8 @@ type ARIARoleRelationConcept = {

type ARIARoleRelationConceptAttribute = {
name: string,
value?: string,
value?: string | number,
// Make these explicit. These values represent quirks of the mapping betweent
// ARIA and other semantic ontological systems.
constraints?: Array<'unset' | '>1'>,
};
3 changes: 3 additions & 0 deletions scripts/breakUpAriaJSON.js
Expand Up @@ -94,6 +94,9 @@ function triageValue(value, depth = 0) {
case 'string':
output = output.concat(`\'${value}\'`);
break;
case 'number':
output = output.concat(`${value}`);
break;
default:
output.push('null');
}
Expand Down
54 changes: 53 additions & 1 deletion scripts/roles.json
Expand Up @@ -4038,7 +4038,59 @@
"abstract": true,
"childrenPresentational": false,
"baseConcepts": [],
"relatedConcepts": []
"relatedConcepts": [{
"module": "ARIA",
"concept": {
"name": "combobox",
"attributes": [{
"name": "multiple",
"constraints": ["unset"]
}, {
"name": "size",
"constraints": ["unset"]
}]
}
}, {
"module": "ARIA",
"concept": {
"name": "combobox",
"attributes": [{
"name": "multiple",
"constraints": ["unset"]
}, {
"name": "size",
"value": 1
}]
}
}, {
"module": "ARIA",
"concept": {
"name": "listbox",
"attributes": [{
"name": "multiple"
}]
}
}, {
"module": "ARIA",
"concept": {
"name": "listbox",
"attributes": [{
"name": "multiple"
}, {
"name": "size",
"constraints": [">1"]
}]
}
}, {
"module": "ARIA",
"concept": {
"name": "listbox",
"attributes": [{
"name": "size",
"constraints": [">1"]
}]
}
}]
},
"separator": {
"superClass": ["structure"],
Expand Down
83 changes: 82 additions & 1 deletion src/etc/roles/abstract/selectRole.js
Expand Up @@ -12,7 +12,88 @@ const selectRole: ARIARoleDefinition = {
props: {
'aria-orientation': null,
},
relatedConcepts: [],
relatedConcepts: [
{
module: 'ARIA',
concept: {
name: 'combobox',
attributes: [
{
name: 'multiple',
constraints: [
'unset',
],
},
{
name: 'size',
constraints: [
'unset',
],
},
],
},
},
{
module: 'ARIA',
concept: {
name: 'combobox',
attributes: [
{
name: 'multiple',
constraints: [
'unset',
],
},
{
name: 'size',
value: 1,
},
],
},
},
{
module: 'ARIA',
concept: {
name: 'listbox',
attributes: [
{
name: 'multiple',
},
],
},
},
{
module: 'ARIA',
concept: {
name: 'listbox',
attributes: [
{
name: 'multiple',
},
{
name: 'size',
constraints: [
'>1',
],
},
],
},
},
{
module: 'ARIA',
concept: {
name: 'listbox',
attributes: [
{
name: 'size',
constraints: [
'>1',
],
},
],
},
},
],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
Expand Down

0 comments on commit c3c510d

Please sign in to comment.