8258659: Eliminate whitespace comments from generated pages

Reviewed-by: hannesw
This commit is contained in:
Jonathan Gibbons 2021-01-11 18:46:52 +00:00
parent 386196023e
commit c956e7a69c
4 changed files with 10 additions and 27 deletions

View File

@ -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,
@ -953,7 +951,7 @@ public class Navigation {
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;

View File

@ -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
@ -54,8 +54,6 @@ public class AccessSkipNav extends JavadocTester {
<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>""");
}
}

View File

@ -85,7 +85,6 @@ public class TestAnnotationTypes extends JavadocTester {
"""
<section class="details" id="annotation.interface.element.detail">""",
"<h2>Element Details</h2>",
"<!-- -->",
"</a>",
"<ul class=\"member-list\">",
"<li>",

View File

@ -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
@ -89,9 +89,7 @@ public class TestNavigation extends JavadocTester {
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">
@ -100,9 +98,7 @@ public class TestNavigation extends JavadocTester {
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">
@ -122,9 +118,7 @@ public class TestNavigation extends JavadocTester {
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">
@ -133,9 +127,7 @@ public class TestNavigation extends JavadocTester {
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>
""");
}
@ -153,9 +145,7 @@ public class TestNavigation extends JavadocTester {
"""
<!-- ========= 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 ======== -->""");
@ -164,9 +154,7 @@ public class TestNavigation extends JavadocTester {
"""
<!-- ========= 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>""");
}