Skip to content

Commit

Permalink
8311893: Interactive component with ARIA role 'tabpanel' does not hav…
Browse files Browse the repository at this point in the history
…e a programmatically associated name

Reviewed-by: hannesw
  • Loading branch information
psoujany authored and hns committed Feb 2, 2024
1 parent d3c3194 commit 783ae56
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ private Content toContent() {
} else {
tablist.add(getCaption(defaultTab));
}
table.put(HtmlAttr.ARIA_LABELLEDBY, defaultTabId.name());
if (renderTabs) {
for (var tab : tabs) {
if (occurringTabs.contains(tab)) {
Expand All @@ -417,7 +416,8 @@ private Content toContent() {
}
var tabpanel = new HtmlTree(TagName.DIV)
.setId(HtmlIds.forTabPanel(id))
.put(HtmlAttr.ROLE, "tabpanel");
.put(HtmlAttr.ROLE, "tabpanel")
.put(HtmlAttr.ARIA_LABELLEDBY, defaultTabId.name());
table.add(getTableBody());
tabpanel.add(table);
main.add(tablist);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function show(tableId, selected, columns) {
}

function updateTabs(tableId, selected) {
document.querySelector('div#' + tableId +' .summary-table')
document.getElementById(tableId + '.tabpanel')
.setAttribute('aria-labelledby', selected);
document.querySelectorAll('button[id^="' + tableId + '"]')
.forEach(function(tab, index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void test() {
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">""",
"""
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">""");
<div class="summary-table three-column-summary">""");

checkOutput("pkg1/package-summary.html", true,
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ void checkHtmlTableTag() {
//Package summary
checkOutput("pkg1/package-summary.html", true,
"""
<div class="summary-table two-column-summary" aria-labelledby="class-summary-tab0">""");
<div class="summary-table two-column-summary">""");

checkOutput("pkg2/package-summary.html", true,
"""
<div class="summary-table two-column-summary" aria-labelledby="class-summary-tab0">""");
<div class="summary-table two-column-summary">""");

// Class documentation
checkOutput("pkg1/C1.html", true,
"""
<div class="summary-table three-column-summary">""",
"""
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">""");
<div class="summary-table three-column-summary">""");

checkOutput("pkg2/C2.html", true,
"""
<div class="summary-table three-column-summary">""",
"""
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">""");
<div class="summary-table three-column-summary">""");

checkOutput("pkg2/C2.ModalExclusionType.html", true,
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void html5Output() {
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
""",
"""
<div class="summary-table two-column-summary" aria-labelledby="class-summary-tab0">""",
<div class="summary-table two-column-summary">""",
"""
<header role="banner">
<nav role="navigation">
Expand Down Expand Up @@ -412,7 +412,7 @@ void html5Output() {
<div class="caption"><span>Enum Constants</span></div>
""",
"""
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
""",
"""
<section class="method-summary" id="method-summary">
Expand Down Expand Up @@ -453,7 +453,7 @@ void html5Output() {
<div id="method-summary-table">
""",
"""
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="summary-table three-column-summary">
""",
"""
<section class="method-details" id="method-detail">
Expand Down
10 changes: 5 additions & 5 deletions test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
Original file line number Diff line number Diff line change
Expand Up @@ -1189,8 +1189,8 @@ void checkGroupOption() {
ck="show('all-modules-table', 'all-modules-table-tab3', 2)" class="table-tab">Ot\
her Modules</button>\
</div>
<div id="all-modules-table.tabpanel" role="tabpanel">
<div class="summary-table two-column-summary" aria-labelledby="all-modules-table-tab0">""");
<div id="all-modules-table.tabpanel" role="tabpanel" aria-labelledby="all-modules-table-tab0">
<div class="summary-table two-column-summary">""");
checkOutput("index.html", false,
"""
<div class="overview-summary">
Expand Down Expand Up @@ -1270,8 +1270,8 @@ void checkUnnamedModuleGroupOption() {
ck="show('all-packages-table', 'all-packages-table-tab2', 2)" class="table-tab">P\
ackage Group 1</button>\
</div>
<div id="all-packages-table.tabpanel" role="tabpanel">
<div class="summary-table two-column-summary" aria-labelledby="all-packages-table-tab0">""");
<div id="all-packages-table.tabpanel" role="tabpanel" aria-labelledby="all-packages-table-tab0">
<div class="summary-table two-column-summary">""");
}

void checkGroupOptionPackageOrdering() {
Expand Down Expand Up @@ -1421,7 +1421,7 @@ void checkAllPkgsAllClasses(boolean found) {
""");
checkOutput("allclasses-index.html", found,
"""
<div class="summary-table two-column-summary" aria-labelledby="all-classes-table-tab0">
<div class="summary-table two-column-summary">
""");
checkOutput("allpackages-index.html", found,
"""
Expand Down
Loading

1 comment on commit 783ae56

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.