Skip to content

Commit

Permalink
fix: add missing constraints for aside element to have implicit `co…
Browse files Browse the repository at this point in the history
…mplementary` role
  • Loading branch information
jlp-craigmorten authored and samccone committed Jul 7, 2024
1 parent d5024d2 commit 5674a71
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/src/elementRoleMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const entriesList = [
[{"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "text"}], "name": "input"}, ["combobox"]],
[{"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "url"}], "name": "input"}, ["combobox"]],
[{"attributes": [{"constraints": ["undefined"], "name": "multiple"}, {"constraints": ["undefined"], "name": "size"}], "constraints": ["the multiple attribute is not set and the size attribute does not have a value greater than 1"], "name": "select"}, ["combobox"]],
[{"name": "aside"}, ["complementary"]],
[{"constraints": ["scoped to the body element", "scoped to the main element"], "name": "aside"}, ["complementary"]],
[{"attributes": [{"constraints": ["set"], "name": "aria-label"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}, ["complementary"]],
[{"attributes": [{"constraints": ["set"], "name": "aria-labelledby"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}, ["complementary"]],
[{"constraints": ["scoped to the body element"], "name": "footer"}, ["contentinfo"]],
Expand Down
2 changes: 1 addition & 1 deletion __tests__/src/roleElementMap-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const entriesList = [
["code", [{"name": "code"}]],
["columnheader", [{"name": "th"}, {"attributes": [{"name": "scope", "value": "col"}], "name": "th"}, {"attributes": [{"name": "scope", "value": "colgroup"}], "name": "th"}]],
["combobox", [{"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "email"}], "name": "input"}, {"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "search"}], "name": "input"}, {"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "tel"}], "name": "input"}, {"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "text"}], "name": "input"}, {"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "url"}], "name": "input"}, {"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "url"}], "name": "input"}, {"attributes": [{"constraints": ["undefined"], "name": "multiple"}, {"constraints": ["undefined"], "name": "size"}], "constraints": ["the multiple attribute is not set and the size attribute does not have a value greater than 1"], "name": "select"}]],
["complementary", [{"name": "aside"}, {"attributes": [{"constraints": ["set"], "name": "aria-label"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}, {"attributes": [{"constraints": ["set"], "name": "aria-labelledby"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}]],
["complementary", [{"constraints": ["scoped to the body element", "scoped to the main element"], "name": "aside"}, {"attributes": [{"constraints": ["set"], "name": "aria-label"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}, {"attributes": [{"constraints": ["set"], "name": "aria-labelledby"}], "constraints": ["scoped to a sectioning content element", "scoped to a sectioning root element other than body"], "name": "aside"}]],
["contentinfo", [{"constraints": ["scoped to the body element"], "name": "footer"}]],
["definition", [{"name": "dd"}]],
["deletion", [{"name": "del"}]],
Expand Down
4 changes: 4 additions & 0 deletions scripts/roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,10 @@
"relatedConcepts": [
{
"concept": {
"constraints": [
"scoped to the body element",
"scoped to the main element"
],
"name": "aside"
},
"module": "HTML"
Expand Down
4 changes: 4 additions & 0 deletions src/etc/roles/literal/complementaryRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const complementaryRole: ARIARoleDefinition = {
relatedConcepts: [
{
concept: {
constraints: [
'scoped to the body element',
'scoped to the main element',
],
name: 'aside',
},
module: 'HTML',
Expand Down

0 comments on commit 5674a71

Please sign in to comment.