diff --git a/lib/standards/aria-roles.js b/lib/standards/aria-roles.js index 95ba637130..e608ab40df 100644 --- a/lib/standards/aria-roles.js +++ b/lib/standards/aria-roles.js @@ -18,38 +18,46 @@ const ariaRoles = { alert: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, alertdialog: { type: 'widget', - allowedAttrs: ['aria-expanded', 'aria-modal'] + allowedAttrs: ['aria-expanded', 'aria-modal'], + superclassRole: ['alert', 'dialog'] }, application: { // Note: spec difference type: 'landmark', // Note: aria-expanded is not in the 1.1 spec but is // consistently supported in ATs and was added in 1.2 - allowedAttrs: ['aria-activedescendant', 'aria-expanded'] + allowedAttrs: ['aria-activedescendant', 'aria-expanded'], + superclassRole: ['structure'] }, article: { type: 'structure', - allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'] + allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'], + superclassRole: ['document'] }, banner: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, blockquote: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, button: { type: 'widget', allowedAttrs: ['aria-expanded', 'aria-pressed'], + superclassRole: ['command'], nameFromContent: true }, caption: { type: 'structure', - requiredContext: ['figure', 'table', 'grid', 'treegrid'] + requiredContext: ['figure', 'table', 'grid', 'treegrid'], + superclassRole: ['section'] }, cell: { type: 'structure', @@ -61,6 +69,7 @@ const ariaRoles = { 'aria-rowspan', 'aria-expanded' ], + superclassRole: ['section'], nameFromContent: true }, checkbox: { @@ -72,10 +81,12 @@ const ariaRoles = { // Note: aria-required is not in the 1.1 spec but is // consistently supported in ATs and was added in 1.2 allowedAttrs: ['aria-checked', 'aria-readonly', 'aria-required'], + superclassRole: ['input'], nameFromContent: true }, code: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, columnheader: { type: 'structure', @@ -91,6 +102,7 @@ const ariaRoles = { 'aria-rowspan', 'aria-selected' ], + superclassRole: ['cell', 'gridcell', 'sectionhead'], nameFromContent: true }, combobox: { @@ -107,60 +119,74 @@ const ariaRoles = { 'aria-required', 'aria-activedescendant', 'aria-orientation' - ] + ], + superclassRole: ['select'] }, command: { - type: 'abstract' + type: 'abstract', + superclassRole: ['widget'] }, complementary: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, composite: { - type: 'abstract' + type: 'abstract', + superclassRole: ['widget'] }, contentinfo: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, definition: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, deletion: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, dialog: { type: 'widget', - allowedAttrs: ['aria-expanded', 'aria-modal'] + allowedAttrs: ['aria-expanded', 'aria-modal'], + superclassRole: ['window'] }, directory: { type: 'structure', allowedAttrs: ['aria-expanded'], + superclassRole: ['list'], // Note: spec difference nameFromContent: true }, document: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['structure'] }, emphasis: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, feed: { type: 'structure', requiredOwned: ['article'], - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['list'] }, figure: { type: 'structure', allowedAttrs: ['aria-expanded'], + superclassRole: ['section'], // Note: spec difference nameFromContent: true }, form: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, grid: { type: 'composite', @@ -173,7 +199,8 @@ const ariaRoles = { 'aria-colcount', 'aria-expanded', 'aria-rowcount' - ] + ], + superclassRole: ['composite', 'table'] }, gridcell: { type: 'widget', @@ -188,40 +215,49 @@ const ariaRoles = { 'aria-rowindex', 'aria-rowspan' ], + superclassRole: ['cell', 'widget'], nameFromContent: true }, group: { type: 'structure', - allowedAttrs: ['aria-activedescendant', 'aria-expanded'] + allowedAttrs: ['aria-activedescendant', 'aria-expanded'], + superclassRole: ['section'] }, heading: { type: 'structure', requiredAttrs: ['aria-level'], allowedAttrs: ['aria-expanded'], + superclassRole: ['sectionhead'], nameFromContent: true }, img: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, input: { - type: 'abstract' + type: 'abstract', + superclassRole: ['widget'] }, insertion: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, landmark: { - type: 'abstract' + type: 'abstract', + superclassRole: ['section'] }, link: { type: 'widget', allowedAttrs: ['aria-expanded'], + superclassRole: ['command'], nameFromContent: true }, list: { type: 'structure', requiredOwned: ['listitem'], - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, listbox: { type: 'composite', @@ -233,7 +269,8 @@ const ariaRoles = { 'aria-activedescendant', 'aria-expanded', 'aria-orientation' - ] + ], + superclassRole: ['select'] }, listitem: { type: 'structure', @@ -244,34 +281,49 @@ const ariaRoles = { 'aria-setsize', 'aria-expanded' ], + superclassRole: ['section'], // Note: spec difference nameFromContent: true }, log: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, main: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, marquee: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, math: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, menu: { type: 'composite', requiredOwned: ['menuitemradio', 'menuitem', 'menuitemcheckbox'], - allowedAttrs: ['aria-activedescendant', 'aria-expanded', 'aria-orientation'] + allowedAttrs: [ + 'aria-activedescendant', + 'aria-expanded', + 'aria-orientation' + ], + superclassRole: ['select'] }, menubar: { type: 'composite', requiredOwned: ['menuitemradio', 'menuitem', 'menuitemcheckbox'], - allowedAttrs: ['aria-activedescendant', 'aria-expanded', 'aria-orientation'] + allowedAttrs: [ + 'aria-activedescendant', + 'aria-expanded', + 'aria-orientation' + ], + superclassRole: ['menu'] }, menuitem: { type: 'widget', @@ -279,6 +331,7 @@ const ariaRoles = { // Note: aria-expanded is not in the 1.1 spec but is // consistently supported in ATs and was added in 1.2 allowedAttrs: ['aria-posinset', 'aria-setsize', 'aria-expanded'], + superclassRole: ['command'], nameFromContent: true }, menuitemcheckbox: { @@ -290,6 +343,7 @@ const ariaRoles = { 'aria-readonly', 'aria-setsize' ], + superclassRole: ['checkbox', 'menuitem'], nameFromContent: true }, menuitemradio: { @@ -301,23 +355,28 @@ const ariaRoles = { 'aria-readonly', 'aria-setsize' ], + superclassRole: ['menuitemcheckbox', 'radio'], nameFromContent: true }, meter: { type: 'structure', allowedAttrs: ['aria-valuetext'], - requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow'] + requiredAttrs: ['aria-valuemax', 'aria-valuemin', 'aria-valuenow'], + superclassRole: ['range'] }, navigation: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, none: { - type: 'structure' + type: 'structure', + superclassRole: ['structure'] }, note: { type: 'structure', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, option: { type: 'widget', @@ -331,13 +390,16 @@ const ariaRoles = { 'aria-posinset', 'aria-setsize' ], + superclassRole: ['input'], nameFromContent: true }, paragraph: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, presentation: { - type: 'structure' + type: 'structure', + superclassRole: ['structure'] }, progressbar: { type: 'widget', @@ -347,7 +409,8 @@ const ariaRoles = { 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' - ] + ], + superclassRole: ['range'] }, radio: { type: 'widget', @@ -363,6 +426,7 @@ const ariaRoles = { 'aria-setsize', 'aria-required' ], + superclassRole: ['input'], nameFromContent: true }, radiogroup: { @@ -374,17 +438,21 @@ const ariaRoles = { 'aria-activedescendant', 'aria-expanded', 'aria-orientation' - ] + ], + superclassRole: ['select'] }, range: { - type: 'abstract' + type: 'abstract', + superclassRole: ['widget'] }, region: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, roletype: { - type: 'abstract' + type: 'abstract', + superclassRole: [] }, row: { type: 'structure', @@ -398,12 +466,14 @@ const ariaRoles = { 'aria-activedescendant', 'aria-expanded' ], + superclassRole: ['group', 'widget'], nameFromContent: true }, rowgroup: { type: 'structure', requiredContext: ['grid', 'table', 'treegrid'], requiredOwned: ['row'], + superclassRole: ['structure'], nameFromContent: true }, rowheader: { @@ -420,6 +490,7 @@ const ariaRoles = { 'aria-rowspan', 'aria-selected' ], + superclassRole: ['cell', 'gridcell', 'sectionhead'], nameFromContent: true }, scrollbar: { @@ -438,11 +509,13 @@ const ariaRoles = { 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' - ] + ], + superclassRole: ['range'] }, search: { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, searchbox: { type: 'widget', @@ -453,20 +526,24 @@ const ariaRoles = { 'aria-placeholder', 'aria-readonly', 'aria-required' - ] + ], + superclassRole: ['textbox'] }, section: { type: 'abstract', + superclassRole: ['structure'], // Note: spec difference nameFromContent: true }, sectionhead: { type: 'abstract', + superclassRole: ['structure'], // Note: spec difference nameFromContent: true }, select: { - type: 'abstract' + type: 'abstract', + superclassRole: ['composite', 'group'] }, separator: { type: 'structure', @@ -480,7 +557,8 @@ const ariaRoles = { 'aria-valuenow', 'aria-orientation', 'aria-valuetext' - ] + ], + superclassRole: ['structure', 'widget'] }, slider: { type: 'widget', @@ -494,7 +572,8 @@ const ariaRoles = { 'aria-orientation', 'aria-readonly', 'aria-valuetext' - ] + ], + superclassRole: ['input', 'range'] }, spinbutton: { type: 'widget', @@ -509,28 +588,35 @@ const ariaRoles = { 'aria-required', 'aria-activedescendant', 'aria-valuetext' - ] + ], + superclassRole: ['composite', 'input', 'range'] }, status: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, strong: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, structure: { - type: 'abstract' + type: 'abstract', + superclassRole: ['roletype'] }, subscript: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, superscript: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, switch: { type: 'widget', requiredAttrs: ['aria-checked'], allowedAttrs: ['aria-readonly'], + superclassRole: ['checkbox'], nameFromContent: true }, tab: { @@ -542,6 +628,7 @@ const ariaRoles = { 'aria-setsize', 'aria-expanded' ], + superclassRole: ['sectionhead', 'widget'], nameFromContent: true }, table: { @@ -552,6 +639,7 @@ const ariaRoles = { // the accessible text acceptance tests (#139 and #140) require // table be named from content (we even had to special case // table in commons/aria/named-from-contents) + superclassRole: ['section'], nameFromContent: true }, tablist: { @@ -565,15 +653,18 @@ const ariaRoles = { 'aria-orientation', 'aria-activedescendant', 'aria-expanded' - ] + ], + superclassRole: ['composite'] }, tabpanel: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, term: { type: 'structure', allowedAttrs: ['aria-expanded'], + superclassRole: ['section'], // Note: spec difference nameFromContent: true }, @@ -586,22 +677,31 @@ const ariaRoles = { 'aria-placeholder', 'aria-readonly', 'aria-required' - ] + ], + superclassRole: ['input'] }, time: { - type: 'structure' + type: 'structure', + superclassRole: ['section'] }, timer: { type: 'widget', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['status'] }, toolbar: { type: 'structure', - allowedAttrs: ['aria-orientation', 'aria-activedescendant', 'aria-expanded'] + allowedAttrs: [ + 'aria-orientation', + 'aria-activedescendant', + 'aria-expanded' + ], + superclassRole: ['group'] }, tooltip: { type: 'structure', allowedAttrs: ['aria-expanded'], + superclassRole: ['section'], nameFromContent: true }, tree: { @@ -613,7 +713,8 @@ const ariaRoles = { 'aria-activedescendant', 'aria-expanded', 'aria-orientation' - ] + ], + superclassRole: ['select'] }, treegrid: { type: 'composite', @@ -628,7 +729,8 @@ const ariaRoles = { 'aria-readonly', 'aria-required', 'aria-rowcount' - ] + ], + superclassRole: ['grid', 'tree'] }, treeitem: { type: 'widget', @@ -641,13 +743,16 @@ const ariaRoles = { 'aria-selected', 'aria-setsize' ], + superclassRole: ['listitem', 'option'], nameFromContent: true }, widget: { - type: 'abstract' + type: 'abstract', + superclassRole: ['roletype'] }, window: { - type: 'abstract' + type: 'abstract', + superclassRole: ['roletype'] } };