Skip to content

Commit

Permalink
feat(standards/aria-roles): add presentational children property (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
straker authored Dec 15, 2020
1 parent e6cab06 commit 78c239c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
45 changes: 30 additions & 15 deletions lib/standards/aria-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const ariaRoles = {
allowedAttrs: ['aria-expanded', 'aria-pressed'],
superclassRole: ['command'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
caption: {
type: 'structure',
Expand Down Expand Up @@ -86,7 +87,8 @@ const ariaRoles = {
allowedAttrs: ['aria-checked', 'aria-readonly', 'aria-required'],
superclassRole: ['input'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
code: {
type: 'structure',
Expand Down Expand Up @@ -246,7 +248,8 @@ const ariaRoles = {
type: 'structure',
allowedAttrs: ['aria-expanded'],
superclassRole: ['section'],
accessibleNameRequired: true
accessibleNameRequired: true,
childrenPresentational: true
},
input: {
type: 'abstract',
Expand Down Expand Up @@ -318,7 +321,8 @@ const ariaRoles = {
math: {
type: 'structure',
allowedAttrs: ['aria-expanded'],
superclassRole: ['section']
superclassRole: ['section'],
childrenPresentational: true
},
menu: {
type: 'composite',
Expand Down Expand Up @@ -361,7 +365,8 @@ const ariaRoles = {
],
superclassRole: ['checkbox', 'menuitem'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
menuitemradio: {
type: 'widget',
Expand All @@ -374,14 +379,16 @@ const ariaRoles = {
],
superclassRole: ['menuitemcheckbox', 'radio'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
meter: {
type: 'structure',
allowedAttrs: ['aria-valuetext'],
requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow'],
superclassRole: ['range'],
accessibleNameRequired: true
accessibleNameRequired: true,
childrenPresentational: true
},
navigation: {
type: 'landmark',
Expand Down Expand Up @@ -411,7 +418,8 @@ const ariaRoles = {
],
superclassRole: ['input'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
paragraph: {
type: 'structure',
Expand All @@ -431,7 +439,8 @@ const ariaRoles = {
'aria-valuetext'
],
superclassRole: ['range'],
accessibleNameRequired: true
accessibleNameRequired: true,
childrenPresentational: true
},
radio: {
type: 'widget',
Expand All @@ -449,7 +458,8 @@ const ariaRoles = {
],
superclassRole: ['input'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
radiogroup: {
type: 'composite',
Expand Down Expand Up @@ -538,7 +548,8 @@ const ariaRoles = {
'aria-valuemin',
'aria-valuetext'
],
superclassRole: ['range']
superclassRole: ['range'],
childrenPresentational: true
},
search: {
type: 'landmark',
Expand Down Expand Up @@ -587,7 +598,8 @@ const ariaRoles = {
'aria-orientation',
'aria-valuetext'
],
superclassRole: ['structure', 'widget']
superclassRole: ['structure', 'widget'],
childrenPresentational: true
},
slider: {
type: 'widget',
Expand All @@ -603,7 +615,8 @@ const ariaRoles = {
'aria-valuetext'
],
superclassRole: ['input', 'range'],
accessibleNameRequired: true
accessibleNameRequired: true,
childrenPresentational: true
},
spinbutton: {
type: 'widget',
Expand Down Expand Up @@ -649,7 +662,8 @@ const ariaRoles = {
allowedAttrs: ['aria-readonly'],
superclassRole: ['checkbox'],
accessibleNameRequired: true,
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
tab: {
type: 'widget',
Expand All @@ -661,7 +675,8 @@ const ariaRoles = {
'aria-expanded'
],
superclassRole: ['sectionhead', 'widget'],
nameFromContent: true
nameFromContent: true,
childrenPresentational: true
},
table: {
type: 'structure',
Expand Down
3 changes: 2 additions & 1 deletion lib/standards/dpub-roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ const dpubRoles = {
'doc-pagebreak': {
type: 'separator',
allowedAttrs: ['aria-expanded', 'aria-orientation'],
superclassRole: ['separator']
superclassRole: ['separator'],
childrenPresentational: true
},
'doc-pagelist': {
type: 'navigation',
Expand Down

0 comments on commit 78c239c

Please sign in to comment.