Skip to content

Commit c956e7a

Browse files
committedJan 11, 2021
8258659: Eliminate whitespace comments from generated pages
Reviewed-by: hannesw
1 parent 3861960 commit c956e7a

File tree

4 files changed

+10
-27
lines changed

4 files changed

+10
-27
lines changed
 

‎src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Navigation.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ public class Navigation {
8383
private final String rowListTitle;
8484
private final Content searchLabel;
8585

86-
private static final Content EMPTY_COMMENT = new Comment(" ");
87-
8886
public enum PageMode {
8987
ALL_CLASSES,
9088
ALL_PACKAGES,
@@ -953,7 +951,7 @@ public Content getContent() {
953951
tree.add(subDiv);
954952

955953
tree.add(MarkerComments.END_OF_TOP_NAVBAR);
956-
tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, EMPTY_COMMENT)
954+
tree.add(HtmlTree.SPAN(HtmlStyle.skipNav, HtmlTree.EMPTY)
957955
.setId(SectionName.SKIP_NAVBAR_TOP.getName()));
958956

959957
return tree;

‎test/langtools/jdk/javadoc/doclet/AccessSkipNav/AccessSkipNav.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 4638136 7198273 8025633 8081854 8182765
26+
* @bug 4638136 7198273 8025633 8081854 8182765 8258659
2727
* @summary Add ability to skip over nav bar for accessibility
2828
* @library ../../lib
2929
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -54,8 +54,6 @@ public void test() {
5454
<a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a>""",
5555
// Top navbar <span id>
5656
"""
57-
<span class="skip-nav" id="skip.navbar.top">
58-
<!-- -->
59-
</span>""");
57+
<span class="skip-nav" id="skip.navbar.top"></span>""");
6058
}
6159
}

‎test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ public void test() {
8585
"""
8686
<section class="details" id="annotation.interface.element.detail">""",
8787
"<h2>Element Details</h2>",
88-
"<!-- -->",
8988
"</a>",
9089
"<ul class=\"member-list\">",
9190
"<li>",

‎test/langtools/jdk/javadoc/doclet/testNavigation/TestNavigation.java

+7-19
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/*
2525
* @test
2626
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765
27-
* 8196200 8196202 8223378
27+
* 8196200 8196202 8223378 8258659
2828
* @summary Make sure the Next/Prev Class links iterate through all types.
2929
* Make sure the navagation is 2 columns, not 3.
3030
* @library /tools/lib ../../lib
@@ -89,9 +89,7 @@ public void test(Path ignore) {
8989
checkOutput("pkg/A.html", true,
9090
"""
9191
<!-- ========= END OF TOP NAVBAR ========= -->
92-
<span class="skip-nav" id="skip.navbar.top">
93-
<!-- -->
94-
</span></nav>
92+
<span class="skip-nav" id="skip.navbar.top"></span></nav>
9593
</header>
9694
<div class="flex-content">
9795
<main role="main">
@@ -100,9 +98,7 @@ public void test(Path ignore) {
10098
checkOutput("pkg/package-summary.html", true,
10199
"""
102100
<!-- ========= END OF TOP NAVBAR ========= -->
103-
<span class="skip-nav" id="skip.navbar.top">
104-
<!-- -->
105-
</span></nav>
101+
<span class="skip-nav" id="skip.navbar.top"></span></nav>
106102
</header>
107103
<div class="flex-content">
108104
<main role="main">
@@ -122,9 +118,7 @@ public void test1(Path ignore) {
122118
checkOutput("pkg/A.html", true,
123119
"""
124120
<!-- ========= END OF TOP NAVBAR ========= -->
125-
<span class="skip-nav" id="skip.navbar.top">
126-
<!-- -->
127-
</span></nav>
121+
<span class="skip-nav" id="skip.navbar.top"></span></nav>
128122
</header>
129123
<div class="flex-content">
130124
<main role="main">
@@ -133,9 +127,7 @@ public void test1(Path ignore) {
133127
checkOutput("pkg/package-summary.html", true,
134128
"""
135129
<!-- ========= END OF TOP NAVBAR ========= -->
136-
<span class="skip-nav" id="skip.navbar.top">
137-
<!-- -->
138-
</span></nav>
130+
<span class="skip-nav" id="skip.navbar.top"></span></nav>
139131
""");
140132
}
141133

@@ -153,9 +145,7 @@ public void test2(Path ignore) {
153145
"""
154146
<!-- ========= END OF TOP NAVBAR ========= -->
155147
</div>
156-
<div class="skip-nav"><a id="skip.navbar.top">
157-
<!-- -->
158-
</a></div>
148+
<div class="skip-nav"><a id="skip.navbar.top"></a></div>
159149
</nav>
160150
</header>
161151
<!-- ======== START OF CLASS DATA ======== -->""");
@@ -164,9 +154,7 @@ public void test2(Path ignore) {
164154
"""
165155
<!-- ========= END OF TOP NAVBAR ========= -->
166156
</div>
167-
<div class="skip-nav"><a id="skip.navbar.top">
168-
<!-- -->
169-
</a></div>
157+
<div class="skip-nav"><a id="skip.navbar.top"></a></div>
170158
</nav>""");
171159
}
172160

0 commit comments

Comments
 (0)
Please sign in to comment.