From 1b6693092d44aa10b9d4fd093baff674a17a2d30 Mon Sep 17 00:00:00 2001 From: Steven Lambert <2433219+straker@users.noreply.github.com> Date: Thu, 29 Oct 2020 08:22:57 -0600 Subject: [PATCH] feat(standards): add superclassRole to dpubRoles (#2606) --- lib/standards/dpub-roles.js | 117 ++++++++++++++++++++++++------------ 1 file changed, 78 insertions(+), 39 deletions(-) diff --git a/lib/standards/dpub-roles.js b/lib/standards/dpub-roles.js index a4098a3a9e..4d5ff06828 100644 --- a/lib/standards/dpub-roles.js +++ b/lib/standards/dpub-roles.js @@ -2,24 +2,29 @@ const dpubRoles = { 'doc-abstract': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-acknowledgments': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-afterword': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-appendix': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-backlink': { type: 'link', allowedAttrs: ['aria-expanded'], - nameFromContent: true + nameFromContent: true, + superclassRole: ['link'] }, 'doc-biblioentry': { type: 'listitem', @@ -29,45 +34,55 @@ const dpubRoles = { 'aria-level', 'aria-posinset', 'aria-setsize' - ] + ], + superclassRole: ['listitem'] }, 'doc-bibliography': { type: 'landmark', requiredOwned: ['doc-biblioentry'], - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-biblioref': { type: 'link', allowedAttrs: ['aria-expanded'], - nameFromContent: true + nameFromContent: true, + superclassRole: ['link'] }, 'doc-chapter': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-colophon': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-conclusion': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-cover': { type: 'img', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['img'] }, 'doc-credit': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-credits': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-dedication': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-endnote': { type: 'listitem', @@ -77,102 +92,126 @@ const dpubRoles = { 'aria-level', 'aria-posinset', 'aria-setsize' - ] + ], + superclassRole: ['listitem'] }, 'doc-endnotes': { type: 'landmark', requiredOwned: ['doc-endnote'], - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-epigraph': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-epilogue': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-errata': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-example': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-footnote': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-foreword': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-glossary': { type: 'landmark', requiredOwned: ['definition', 'term'], - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-glossref': { type: 'link', allowedAttrs: ['aria-expanded'], - nameFromContent: true + nameFromContent: true, + superclassRole: ['link'] }, 'doc-index': { type: 'navigation', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['navigation'] }, 'doc-introduction': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-noteref': { type: 'link', allowedAttrs: ['aria-expanded'], - nameFromContent: true + nameFromContent: true, + superclassRole: ['link'] }, 'doc-notice': { type: 'note', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['note'] }, 'doc-pagebreak': { type: 'separator', - allowedAttrs: ['aria-expanded', 'aria-orientation'] + allowedAttrs: ['aria-expanded', 'aria-orientation'], + superclassRole: ['separator'] }, 'doc-pagelist': { type: 'navigation', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['navigation'] }, 'doc-part': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-preface': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-prologue': { type: 'landmark', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['landmark'] }, 'doc-pullquote': { - type: 'none' + type: 'none', + superclassRole: ['none'] }, 'doc-qna': { type: 'section', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['section'] }, 'doc-subtitle': { type: 'sectionhead', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['sectionhead'] }, 'doc-tip': { type: 'note', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['note'] }, 'doc-toc': { type: 'navigation', - allowedAttrs: ['aria-expanded'] + allowedAttrs: ['aria-expanded'], + superclassRole: ['navigation'] } };