Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing doc-pagefooter and doc-pageheader roles #549

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion __tests__/src/rolesMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ const entriesList = [
["doc-noteref", expect.any(Object)],
["doc-notice", expect.any(Object)],
["doc-pagebreak", expect.any(Object)],
["doc-pagefooter", expect.any(Object)],
["doc-pageheader", expect.any(Object)],
["doc-pagelist", expect.any(Object)],
["doc-part", expect.any(Object)],
["doc-preface", expect.any(Object)],
Expand Down Expand Up @@ -218,7 +220,7 @@ describe('rolesMap', function () {
});
describe('spread operator', function () {
it('should have a specific length', function () {
expect([...rolesMap].length).toEqual(137);
expect([...rolesMap].length).toEqual(139);
});
test.each([...rolesMap])('Testing element: %o', (obj, roles) => {
expect(entriesList).toEqual(
Expand Down
2 changes: 2 additions & 0 deletions flow/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ type ARIADPubRole =
| 'doc-noteref'
| 'doc-notice'
| 'doc-pagebreak'
| 'doc-pagefooter'
| 'doc-pageheader'
| 'doc-pagelist'
| 'doc-part'
| 'doc-preface'
Expand Down
76 changes: 76 additions & 0 deletions scripts/roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -2355,6 +2355,82 @@
"requiredProps": [],
"superClass": ["separator"]
},
"doc-pagefooter": {
"abstract": false,
"accessibleNameRequired": false,
"childrenPresentational": false,
"nameFrom": ["prohibited"],
"prohibitedProps": [],
"props": [
"aria-atomic",
"aria-braillelabel",
"aria-brailleroledescription",
"aria-busy",
"aria-controls",
"aria-current",
"aria-describedby",
"aria-description",
"aria-details",
"aria-disabled",
"aria-dropeffect",
"aria-errormessage",
"aria-flowto",
"aria-grabbed",
"aria-haspopup",
"aria-hidden",
"aria-invalid",
"aria-keyshortcuts",
"aria-label",
"aria-labelledby",
"aria-live",
"aria-owns",
"aria-relevant",
"aria-roledescription"
],
"relatedConcepts": [],
"requiredContextRole": [],
"requiredOwnedElements": [],
"requiredProps": [],
"superClass": ["section"]
},
"doc-pageheader": {
"abstract": false,
"accessibleNameRequired": false,
"childrenPresentational": false,
"nameFrom": ["prohibited"],
"prohibitedProps": [],
"props": [
"aria-atomic",
"aria-braillelabel",
"aria-brailleroledescription",
"aria-busy",
"aria-controls",
"aria-current",
"aria-describedby",
"aria-description",
"aria-details",
"aria-disabled",
"aria-dropeffect",
"aria-errormessage",
"aria-flowto",
"aria-grabbed",
"aria-haspopup",
"aria-hidden",
"aria-invalid",
"aria-keyshortcuts",
"aria-label",
"aria-labelledby",
"aria-live",
"aria-owns",
"aria-relevant",
"aria-roledescription"
],
"relatedConcepts": [],
"requiredContextRole": [],
"requiredOwnedElements": [],
"requiredProps": [],
"superClass": ["section"]
},
"doc-pagelist": {
"abstract": false,
"accessibleNameRequired": false,
Expand Down
4 changes: 4 additions & 0 deletions src/etc/roles/ariaDpubRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import docIntroductionRole from './dpub/docIntroductionRole';
import docNoterefRole from './dpub/docNoterefRole';
import docNoticeRole from './dpub/docNoticeRole';
import docPagebreakRole from './dpub/docPagebreakRole';
import docPagefooterRole from './dpub/docPagefooterRole';
import docPageheaderRole from './dpub/docPageheaderRole';
import docPagelistRole from './dpub/docPagelistRole';
import docPartRole from './dpub/docPartRole';
import docPrefaceRole from './dpub/docPrefaceRole';
Expand Down Expand Up @@ -72,6 +74,8 @@ const ariaDpubRoles: RoleDefinitions = [
['doc-noteref', docNoterefRole],
['doc-notice', docNoticeRole],
['doc-pagebreak', docPagebreakRole],
['doc-pagefooter', docPagefooterRole],
['doc-pageheader', docPageheaderRole],
['doc-pagelist', docPagelistRole],
['doc-part', docPartRole],
['doc-preface', docPrefaceRole],
Expand Down
36 changes: 36 additions & 0 deletions src/etc/roles/dpub/docPagefooterRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @flow
*/
const docPagefooterRole: ARIARoleDefinition = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: [
'prohibited',
],
prohibitedProps: [],
props: {
'aria-braillelabel': null,
'aria-brailleroledescription': null,
'aria-description': null,
'aria-disabled': null,
'aria-errormessage': null,
'aria-haspopup': null,
'aria-invalid': null,
},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [
[
'roletype',
'structure',
'section',
],
],
};

export default docPagefooterRole;
36 changes: 36 additions & 0 deletions src/etc/roles/dpub/docPageheaderRole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* @flow
*/
const docPageheaderRole: ARIARoleDefinition = {
abstract: false,
accessibleNameRequired: false,
baseConcepts: [],
childrenPresentational: false,
nameFrom: [
'prohibited',
],
prohibitedProps: [],
props: {
'aria-braillelabel': null,
'aria-brailleroledescription': null,
'aria-description': null,
'aria-disabled': null,
'aria-errormessage': null,
'aria-haspopup': null,
'aria-invalid': null,
},
relatedConcepts: [],
requireContextRole: [],
requiredContextRole: [],
requiredOwnedElements: [],
requiredProps: {},
superClass: [
[
'roletype',
'structure',
'section',
],
],
};

export default docPageheaderRole;