Skip to content

Commit

Permalink
feat(aria): Support progressive ARIA 1.1 attributes / roles (#468)
Browse files Browse the repository at this point in the history
Add support for role=feed, role=term, aria-placeholder, aria-modal,
aria-current, aria-keyshortcuts
  • Loading branch information
WilcoFiers committed Aug 7, 2017
1 parent 3de1302 commit ebb2a5d
Showing 1 changed file with 46 additions and 12 deletions.
58 changes: 46 additions & 12 deletions lib/commons/aria/index.js
Expand Up @@ -71,6 +71,9 @@ lookupTables.attributes = {
type: 'nmtoken',
values: ['true', 'false', 'spelling', 'grammar']
},
'aria-keyshortcuts': {
type: 'string'
},
'aria-label': {
type: 'string'
},
Expand All @@ -84,6 +87,10 @@ lookupTables.attributes = {
type: 'nmtoken',
values: ['off', 'polite', 'assertive']
},
'aria-modal': {
type: 'boolean',
values: ['true', 'false']
},
'aria-multiline': {
type: 'boolean',
values: ['true', 'false']
Expand All @@ -99,6 +106,9 @@ lookupTables.attributes = {
'aria-owns': {
type: 'idrefs'
},
'aria-placeholder': {
type: 'string'
},
'aria-posinset': {
type: 'int'
},
Expand Down Expand Up @@ -155,7 +165,7 @@ lookupTables.attributes = {
lookupTables.globalAttributes = [
'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby',
'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed',
'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-label',
'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label',
'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant'
];

Expand All @@ -172,7 +182,7 @@ lookupTables.role = {
'alertdialog': {
type: 'widget',
attributes: {
allowed: ['aria-expanded']
allowed: ['aria-expanded', 'aria-modal']
},
owned: null,
nameFrom: ['author'],
Expand Down Expand Up @@ -240,7 +250,8 @@ lookupTables.role = {
'columnheader': {
type: 'structure',
attributes: {
allowed: ['aria-expanded', 'aria-sort', 'aria-readonly', 'aria-selected', 'aria-required']
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down Expand Up @@ -294,12 +305,12 @@ lookupTables.role = {
owned: null,
nameFrom: ['author'],
context: null,
implicit: ['dd']
implicit: ['dd', 'dfn']
},
'dialog': {
type: 'widget',
attributes: {
allowed: ['aria-expanded']
allowed: ['aria-expanded', 'aria-modal']
},
owned: null,
nameFrom: ['author'],
Expand All @@ -325,6 +336,17 @@ lookupTables.role = {
context: null,
implicit: ['body']
},
'feed': {
type: 'structure',
attributes: {
allowed: ['aria-expanded']
},
owned: {
one: ['article']
},
nameFrom: ['author'],
context: null
},
'form': {
type: 'landmark',
attributes: {
Expand All @@ -350,7 +372,8 @@ lookupTables.role = {
'gridcell': {
type: 'widget',
attributes: {
allowed: ['aria-selected', 'aria-readonly', 'aria-expanded', 'aria-required']
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex',
'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down Expand Up @@ -620,7 +643,7 @@ lookupTables.role = {
'row': {
type: 'structure',
attributes: {
allowed: ['aria-level', 'aria-selected', 'aria-activedescendant', 'aria-expanded']
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowcount']
},
owned: {
one: ['cell', 'columnheader', 'rowheader', 'gridcell']
Expand All @@ -644,7 +667,8 @@ lookupTables.role = {
'rowheader': {
type: 'structure',
attributes: {
allowed: ['aria-sort', 'aria-required', 'aria-readonly', 'aria-expanded', 'aria-selected']
allowed: ['aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan',
'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort']
},
owned: null,
nameFrom: ['author', 'contents'],
Expand Down Expand Up @@ -673,7 +697,7 @@ lookupTables.role = {
'searchbox': {
type: 'widget',
attributes: {
allowed: ['aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required']
allowed: ['aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder']
},
owned: null,
nameFrom: ['author'],
Expand Down Expand Up @@ -787,6 +811,16 @@ lookupTables.role = {
nameFrom: ['author'],
context: null
},
'term': {
type: 'structure',
attributes: {
allowed: ['aria-expanded']
},
owned: null,
nameFrom: ['author', 'contents'],
context: null,
implicit: ['dt']
},
'text': {
type: 'structure',
owned: null,
Expand All @@ -796,7 +830,7 @@ lookupTables.role = {
'textbox': {
type: 'widget',
attributes: {
allowed: ['aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required']
allowed: ['aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder']
},
owned: null,
nameFrom: ['author'],
Expand Down Expand Up @@ -847,8 +881,8 @@ lookupTables.role = {
'treegrid': {
type: 'composite',
attributes: {
allowed: ['aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable',
'aria-readonly', 'aria-required']
allowed: ['aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable',
'aria-readonly', 'aria-required', 'aria-rowcount']
},
owned: {
all: ['treeitem']
Expand Down

0 comments on commit ebb2a5d

Please sign in to comment.