Skip to content

Commit 4c2408d

Browse files
fix: add missing constraints for aside element to have implicit complementary role
1 parent f5b8f4c commit 4c2408d

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

__tests__/src/elementRoleMap-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const entriesList = [
2323
[{"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "text"}], "name": "input"}, ["combobox"]],
2424
[{"attributes": [{"constraints": ["set"], "name": "list"}, {"name": "type", "value": "url"}], "name": "input"}, ["combobox"]],
2525
[{"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"]],
26-
[{"name": "aside"}, ["complementary"]],
26+
[{"constraints": ["scoped to the body element", "scoped to the main element"], "name": "aside"}, ["complementary"]],
2727
[{"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"]],
2828
[{"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"]],
2929
[{"constraints": ["scoped to the body element"], "name": "footer"}, ["contentinfo"]],

__tests__/src/roleElementMap-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const entriesList = [
1212
["code", [{"name": "code"}]],
1313
["columnheader", [{"name": "th"}, {"attributes": [{"name": "scope", "value": "col"}], "name": "th"}, {"attributes": [{"name": "scope", "value": "colgroup"}], "name": "th"}]],
1414
["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"}]],
15-
["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"}]],
15+
["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"}]],
1616
["contentinfo", [{"constraints": ["scoped to the body element"], "name": "footer"}]],
1717
["definition", [{"name": "dd"}]],
1818
["deletion", [{"name": "del"}]],

scripts/roles.json

+4
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,10 @@
803803
"relatedConcepts": [
804804
{
805805
"concept": {
806+
"constraints": [
807+
"scoped to the body element",
808+
"scoped to the main element"
809+
],
806810
"name": "aside"
807811
},
808812
"module": "HTML"

src/etc/roles/literal/complementaryRole.js

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const complementaryRole: ARIARoleDefinition = {
1414
relatedConcepts: [
1515
{
1616
concept: {
17+
constraints: [
18+
'scoped to the body element',
19+
'scoped to the main element',
20+
],
1721
name: 'aside',
1822
},
1923
module: 'HTML',

0 commit comments

Comments
 (0)