Skip to content

Commit

Permalink
8258659: Eliminate whitespace comments from generated pages
Browse files Browse the repository at this point in the history
Reviewed-by: hannesw
  • Loading branch information
jonathan-gibbons committed Jan 11, 2021
1 parent 3861960 commit c956e7a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
Expand Up @@ -83,8 +83,6 @@ public class Navigation {
private final String rowListTitle;
private final Content searchLabel;

private static final Content EMPTY_COMMENT = new Comment(" ");

public enum PageMode {
ALL_CLASSES,
ALL_PACKAGES,
Expand Down Expand Up @@ -953,7 +951,7 @@ public Content getContent() {
tree.add(subDiv);

tree.add(MarkerComments.END_OF_TOP_NAVBAR);
tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, EMPTY_COMMENT)
tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, HtmlTree.EMPTY)
.setId(SectionName.SKIP_NAVBAR_TOP.getName()));

return tree;
Expand Down
Expand Up @@ -23,7 +23,7 @@

/*
* @test
* @bug 4638136 7198273 8025633 8081854 8182765
* @bug 4638136 7198273 8025633 8081854 8182765 8258659
* @summary Add ability to skip over nav bar for accessibility
* @library ../../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
Expand Down Expand Up @@ -54,8 +54,6 @@ public void test() {
<a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a>""",
// Top navbar <span id>
"""
<span class="skip-nav" id="skip.navbar.top">
<!-- -->
</span>""");
<span class="skip-nav" id="skip.navbar.top"></span>""");
}
}
Expand Up @@ -85,7 +85,6 @@ public void test() {
"""
<section class="details" id="annotation.interface.element.detail">""",
"<h2>Element Details</h2>",
"<!-- -->",
"</a>",
"<ul class=\"member-list\">",
"<li>",
Expand Down
Expand Up @@ -24,7 +24,7 @@
/*
* @test
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765
* 8196200 8196202 8223378
* 8196200 8196202 8223378 8258659
* @summary Make sure the Next/Prev Class links iterate through all types.
* Make sure the navagation is 2 columns, not 3.
* @library /tools/lib ../../lib
Expand Down Expand Up @@ -89,9 +89,7 @@ public void test(Path ignore) {
checkOutput("pkg/A.html", true,
"""
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip.navbar.top">
<!-- -->
</span></nav>
<span class="skip-nav" id="skip.navbar.top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
Expand All @@ -100,9 +98,7 @@ public void test(Path ignore) {
checkOutput("pkg/package-summary.html", true,
"""
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip.navbar.top">
<!-- -->
</span></nav>
<span class="skip-nav" id="skip.navbar.top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
Expand All @@ -122,9 +118,7 @@ public void test1(Path ignore) {
checkOutput("pkg/A.html", true,
"""
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip.navbar.top">
<!-- -->
</span></nav>
<span class="skip-nav" id="skip.navbar.top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
Expand All @@ -133,9 +127,7 @@ public void test1(Path ignore) {
checkOutput("pkg/package-summary.html", true,
"""
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip.navbar.top">
<!-- -->
</span></nav>
<span class="skip-nav" id="skip.navbar.top"></span></nav>
""");
}

Expand All @@ -153,9 +145,7 @@ public void test2(Path ignore) {
"""
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="skip-nav"><a id="skip.navbar.top">
<!-- -->
</a></div>
<div class="skip-nav"><a id="skip.navbar.top"></a></div>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->""");
Expand All @@ -164,9 +154,7 @@ public void test2(Path ignore) {
"""
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="skip-nav"><a id="skip.navbar.top">
<!-- -->
</a></div>
<div class="skip-nav"><a id="skip.navbar.top"></a></div>
</nav>""");
}

Expand Down

1 comment on commit c956e7a

@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.