Skip to content

8359024: Accessibility bugs in API documentation #25716

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

Open
wants to merge 1 commit into
base: master
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,12 @@ private Content toContent() {
table.add(getTableBody());
main.add(table);
} else {
var tablist = HtmlTree.DIV(HtmlStyles.tableTabs)
.put(HtmlAttr.ROLE, "tablist")
.put(HtmlAttr.ARIA_ORIENTATION, "horizontal");
var tablist = HtmlTree.DIV(HtmlStyles.tableTabs);

HtmlId defaultTabId = HtmlIds.forTab(id, 0);
if (renderTabs) {
tablist.put(HtmlAttr.ROLE, "tablist")
.put(HtmlAttr.ARIA_ORIENTATION, "horizontal");
tablist.add(createTab(defaultTabId, HtmlStyles.activeTableTab, true, defaultTab));
for (var tab : tabs) {
if (occurringTabs.contains(tab)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
--block-line-height: 1.5;
--code-line-height: 1.6;
/* Text colors for body and block elements */
--body-text-color: #282828;
--block-text-color: #282828;
--body-text-color: #181818;
--block-text-color: #181818;
/* Background colors for various elements */
--body-background-color: #ffffff;
--section-background-color: var(--body-background-color);
Expand Down Expand Up @@ -656,14 +656,14 @@ ul.preview-feature-list input {
.class-use-page .caption span,
.package-use-page .caption span,
.constants-summary-page .caption span,
.inherited-list.expanded h3 {
.inherited-list h3 {
background-color: var(--subnav-background-color);
color: var(--block-text-color);
}
.caption a:link,
.caption a:visited,
.inherited-list.expanded h3 a:link,
.inherited-list.expanded h3 a:visited {
.inherited-list h3 a:link,
.inherited-list h3 a:visited {
color:var(--subnav-link-color);
}
div.table-tabs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

/*
* @test
* @bug 8263468 8269401 8268422 8287524 8325874 8331873 8345555
* @bug 8263468 8269401 8268422 8287524 8325874 8331873 8345555 8359024
* @summary New page for "recent" new API
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
Expand Down Expand Up @@ -126,7 +126,7 @@ private void checkMultiReleaseNewElements() {
checkOutput("new-list.html", true,
"""
<div id="module">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Modules</span></div>
</div>
<div id="module.tabpanel" role="tabpanel" aria-labelledby="module-tab0">
Expand All @@ -142,7 +142,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="package">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Packages</span></div>
</div>
<div id="package.tabpanel" role="tabpanel" aria-labelledby="package-tab0">
Expand All @@ -158,7 +158,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="interface">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Interfaces</span></div>
</div>
<div id="interface.tabpanel" role="tabpanel" aria-labelledby="interface-tab0">
Expand All @@ -174,7 +174,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Classes</span></div>
</div>
<div id="class.tabpanel" role="tabpanel" aria-labelledby="class-tab0">
Expand All @@ -190,7 +190,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="enum-class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Enum Classes</span></div>
</div>
<div id="enum-class.tabpanel" role="tabpanel" aria-labelledby="enum-class-tab0">
Expand All @@ -206,7 +206,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="exception-class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Exception Classes</span></div>
</div>
<div id="exception-class.tabpanel" role="tabpanel" aria-labelledby="exception-class-tab0">
Expand All @@ -228,7 +228,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="record-class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Record Classes</span></div>
</div>
<div id="record-class.tabpanel" role="tabpanel" aria-labelledby="record-class-tab0">
Expand All @@ -244,7 +244,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="annotation-interface">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Annotation Interfaces</span></div>
</div>
<div id="annotation-interface.tabpanel" role="tabpanel" aria-labelledby="annotation-interface-tab0">
Expand All @@ -259,7 +259,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="field">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Fields</span></div>
</div>
<div id="field.tabpanel" role="tabpanel" aria-labelledby="field-tab0">
Expand Down Expand Up @@ -293,7 +293,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="method">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Methods</span></div>
</div>
<div id="method.tabpanel" role="tabpanel" aria-labelledby="method-tab0">
Expand Down Expand Up @@ -359,7 +359,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="constructor">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Constructors</span></div>
</div>
<div id="constructor.tabpanel" role="tabpanel" aria-labelledby="constructor-tab0">
Expand Down Expand Up @@ -394,7 +394,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="enum-constant">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Enum Constants</span></div>
</div>
<div id="enum-constant.tabpanel" role="tabpanel" aria-labelledby="enum-constant-tab0">
Expand Down Expand Up @@ -428,7 +428,7 @@ private void checkMultiReleaseNewElements() {
</div>""",
"""
<div id="annotation-interface-member">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Annotation Interface Elements</span></div>
</div>
<div id="annotation-interface-member.tabpanel" role="tabpanel" aria-labelledby="annotation-interface-member-tab0">
Expand Down Expand Up @@ -456,7 +456,7 @@ private void checkMultiReleaseDeprecatedElements() {
checkOutput("deprecated-list.html", true,
"""
<div id="for-removal">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Terminally Deprecated Elements</span></div>
</div>
<div id="for-removal.tabpanel" role="tabpanel" aria-labelledby="for-removal-tab0">
Expand All @@ -471,7 +471,7 @@ private void checkMultiReleaseDeprecatedElements() {
</div>""",
"""
<div id="method">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Methods</span></div>
</div>
<div id="method.tabpanel" role="tabpanel" aria-labelledby="method-tab0">
Expand All @@ -486,7 +486,7 @@ private void checkMultiReleaseDeprecatedElements() {
</div>""",
"""
<div id="constructor">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Constructors</span></div>
</div>
<div id="constructor.tabpanel" role="tabpanel" aria-labelledby="constructor-tab0">
Expand All @@ -501,7 +501,7 @@ private void checkMultiReleaseDeprecatedElements() {
</div>""",
"""
<div id="enum-constant">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Enum Constants</span></div>
</div>
<div id="enum-constant.tabpanel" role="tabpanel" aria-labelledby="enum-constant-tab0">
Expand All @@ -516,7 +516,7 @@ private void checkMultiReleaseDeprecatedElements() {
</div>""",
"""
<div id="annotation-interface-member">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Annotation Interface Elements</span></div>
</div>
<div id="annotation-interface-member.tabpanel" role="tabpanel" aria-labelledby="annotation-interface-member-tab0">
Expand Down Expand Up @@ -606,7 +606,7 @@ private void checkSingleReleaseDeprecatedElements() {
</ul>""",
"""
<div id="for-removal">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Terminally Deprecated Elements</span></div>
</div>
<div id="for-removal.tabpanel" role="tabpanel" aria-labelledby="for-removal-tab0">
Expand All @@ -621,7 +621,7 @@ private void checkSingleReleaseDeprecatedElements() {
</div>""",
"""
<div id="method">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Methods</span></div>
</div>
<div id="method.tabpanel" role="tabpanel" aria-labelledby="method-tab0">
Expand All @@ -636,7 +636,7 @@ private void checkSingleReleaseDeprecatedElements() {
</div>""",
"""
<div id="constructor">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Deprecated Constructors</span></div>
</div>
<div id="constructor.tabpanel" role="tabpanel" aria-labelledby="constructor-tab0">
Expand Down Expand Up @@ -680,7 +680,7 @@ private void checkPackageNewElements() {
checkOutput("new-list.html", true,
"""
<div id="class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Classes</span></div>
</div>
<div id="class.tabpanel" role="tabpanel" aria-labelledby="class-tab0">
Expand All @@ -696,7 +696,7 @@ private void checkPackageNewElements() {
</div>""",
"""
<div id="field">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Fields</span></div>
</div>
<div id="field.tabpanel" role="tabpanel" aria-labelledby="field-tab0">
Expand All @@ -712,7 +712,7 @@ private void checkPackageNewElements() {
</div>""",
"""
<div id="method">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Methods</span></div>
</div>
<div id="method.tabpanel" role="tabpanel" aria-labelledby="method-tab0">
Expand Down Expand Up @@ -741,7 +741,7 @@ private void checkPackageNewElements() {
</div>""",
"""
<div id="constructor">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>New Constructors</span></div>
</div>
<div id="constructor.tabpanel" role="tabpanel" aria-labelledby="constructor-tab0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
/*
* @test
* @bug 8250768 8261976 8277300 8282452 8287597 8325325 8325874 8297879
* 8331947 8281533 8343239 8318416 8346109
* 8331947 8281533 8343239 8318416 8346109 8359024
* @summary test generated docs for items declared using preview
* @library /tools/lib ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
Expand Down Expand Up @@ -104,7 +104,7 @@ public void testPreviewAPIJavadoc() {
""",
"""
<div id="package">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Packages</span></div>
</div>
<div id="package.tabpanel" role="tabpanel" aria-labelledby="package-tab0">
Expand All @@ -122,7 +122,7 @@ public void testPreviewAPIJavadoc() {
""",
"""
<div id="record-class">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Record Classes</span></div>
</div>
<div id="record-class.tabpanel" role="tabpanel" aria-labelledby="record-class-tab0">
Expand All @@ -139,7 +139,7 @@ public void testPreviewAPIJavadoc() {
""",
"""
<div id="method">
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
<div class="table-tabs">
<div class="caption"><span>Methods</span></div>
</div>
<div id="method.tabpanel" role="tabpanel" aria-labelledby="method-tab0">
Expand Down