Skip to content

Commit f6a79e3

Browse files
committedJun 7, 2022
8287674: CSS improvements for summary lists
Reviewed-by: jjg
1 parent ef7cc21 commit f6a79e3

File tree

5 files changed

+30
-20
lines changed

5 files changed

+30
-20
lines changed
 

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected void addExtraSection(DeprecatedAPIListBuilder list, Content content) {
8585
"doclet.Deprecated_API_Checkbox_Label"));
8686
for (int i = 0; i < releases.size(); i++) {
8787
// Table column ids are 1-based
88-
tabs.add(getReleaseCheckbox(releases.get(i), i + 1));
88+
tabs.add(Text.of(" ")).add(getReleaseCheckbox(releases.get(i), i + 1));
8989
}
9090
content.add(tabs);
9191
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ protected void addExtraSection(NewAPIBuilder list, Content content) {
8686
int releaseIndex = i + 1;
8787
String release = releases.get(i);
8888
HtmlId htmlId = HtmlId.of("release-" + releaseIndex);
89-
tabs.add(HtmlTree.LABEL(htmlId.name(),
89+
tabs.add(Text.of(" ")).add(HtmlTree.LABEL(htmlId.name(),
9090
HtmlTree.INPUT("checkbox", htmlId)
9191
.put(HtmlAttr.CHECKED, "")
9292
.put(HtmlAttr.ONCLICK,

‎src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css

+14-6
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,14 @@ div.table-tabs > button.table-tab {
410410
grid-template-columns: minmax(400px, max-content) minmax(400px, auto);
411411
}
412412
div.checkboxes {
413-
line-height: 18px;
413+
line-height: 2em;
414414
}
415415
div.checkboxes > span {
416416
margin-left: 10px;
417417
}
418418
div.checkboxes > label {
419419
margin-left: 8px;
420+
white-space: nowrap;
420421
}
421422
div.checkboxes > label > input {
422423
margin: 0 2px;
@@ -429,6 +430,10 @@ div.checkboxes > label > input {
429430
display: grid;
430431
grid-template-columns: minmax(15%, max-content) minmax(20%, max-content) minmax(20%, auto);
431432
}
433+
.three-column-release-summary {
434+
display: grid;
435+
grid-template-columns: minmax(40%, max-content) minmax(10%, max-content) minmax(40%, auto);
436+
}
432437
.four-column-summary {
433438
display: grid;
434439
grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, max-content) minmax(15%, auto);
@@ -448,14 +453,15 @@ div.checkboxes > label > input {
448453
display: grid;
449454
grid-template-columns: minmax(10%, max-content) minmax(25%, auto);
450455
}
451-
.three-column-summary .col-last {
456+
.three-column-release-summary {
457+
display: grid;
458+
grid-template-columns: minmax(70%, max-content) minmax(30%, max-content)
459+
}
460+
.three-column-summary .col-last,
461+
.three-column-release-summary .col-last{
452462
grid-column-end: span 2;
453463
}
454464
}
455-
.three-column-release-summary {
456-
display: grid;
457-
grid-template-columns: minmax(40%, max-content) minmax(10%, max-content) minmax(40%, auto);
458-
}
459465
@media screen and (max-width: 600px) {
460466
.two-column-summary {
461467
display: grid;
@@ -465,6 +471,8 @@ div.checkboxes > label > input {
465471
.summary-table > div, .details-table > div {
466472
text-align:left;
467473
padding: 8px 3px 3px 7px;
474+
overflow-x: auto;
475+
scrollbar-width: thin;
468476
}
469477
.col-first, .col-second, .col-last, .col-constructor-name, .col-summary-item-name {
470478
vertical-align:top;

‎test/langtools/jdk/javadoc/doclet/testNewApiList/TestNewApiList.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ private void checkMultiReleaseContents() {
119119
<li><a href="#annotation-interface-member">Annotation Interface Elements</a></li>
120120
</ul>
121121
</div>
122-
<div class="checkboxes">Show API added in:<label for="release-1">
122+
<div class="checkboxes">Show API added in: <label for="release-1">
123123
<input type="checkbox" id="release-1" disabled checked onclick="toggleGlobal(this, '1', 3)">
124-
<span>0.9</span></label><label for="release-2">
124+
<span>0.9</span></label> <label for="release-2">
125125
<input type="checkbox" id="release-2" disabled checked onclick="toggleGlobal(this, '2', 3)">
126-
<span>v1.0</span></label><label for="release-3">
126+
<span>v1.0</span></label> <label for="release-3">
127127
<input type="checkbox" id="release-3" disabled checked onclick="toggleGlobal(this, '3', 3)">
128-
<span>1.2</span></label><label for="release-4">
128+
<span>1.2</span></label> <label for="release-4">
129129
<input type="checkbox" id="release-4" disabled checked onclick="toggleGlobal(this, '4', 3)">
130-
<span>2.0b</span></label><label for="release-5">
130+
<span>2.0b</span></label> <label for="release-5">
131131
<input type="checkbox" id="release-5" disabled checked onclick="toggleGlobal(this, '5', 3)">
132-
<span>3.2</span></label><label for="release-6">
132+
<span>3.2</span></label> <label for="release-6">
133133
<input type="checkbox" id="release-6" disabled checked onclick="toggleGlobal(this, '6', 3)">
134134
<span>5</span></label></div>""");
135135
}
@@ -610,7 +610,7 @@ private void checkSingleReleaseDeprecatedElements() {
610610
<li><a href="#annotation-interface-member">Annotation Interface Elements</a></li>
611611
</ul>
612612
</div>
613-
<div class="checkboxes">Show API deprecated in:<label for="release-1">""",
613+
<div class="checkboxes">Show API deprecated in: <label for="release-1">""",
614614
"""
615615
<div id="for-removal">
616616
<div class="table-tabs" role="tablist" aria-orientation="horizontal">
@@ -670,15 +670,15 @@ private void checkPackageContents() {
670670
<li><a href="#constructor">Constructors</a></li>
671671
</ul>
672672
</div>
673-
<div class="checkboxes">Show API added in:<label for="release-1">
673+
<div class="checkboxes">Show API added in: <label for="release-1">
674674
<input type="checkbox" id="release-1" disabled checked onclick="toggleGlobal(this, '1', 3)">
675-
<span>1.2</span></label><label for="release-2">
675+
<span>1.2</span></label> <label for="release-2">
676676
<input type="checkbox" id="release-2" disabled checked onclick="toggleGlobal(this, '2', 3)">
677-
<span>2.0b</span></label><label for="release-3">
677+
<span>2.0b</span></label> <label for="release-3">
678678
<input type="checkbox" id="release-3" disabled checked onclick="toggleGlobal(this, '3', 3)">
679-
<span>3.2</span></label><label for="release-4">
679+
<span>3.2</span></label> <label for="release-4">
680680
<input type="checkbox" id="release-4" disabled checked onclick="toggleGlobal(this, '4', 3)">
681-
<span>5</span></label><label for="release-5">
681+
<span>5</span></label> <label for="release-5">
682682
<input type="checkbox" id="release-5" disabled checked onclick="toggleGlobal(this, '5', 3)">
683683
<span>6</span></label></div>""");
684684
}

‎test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java

+2
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public void test(Path base) {
139139
.summary-table > div, .details-table > div {
140140
text-align:left;
141141
padding: 8px 3px 3px 7px;
142+
overflow-x: auto;
143+
scrollbar-width: thin;
142144
}""",
143145
"@import url('resources/fonts/dejavu.css');",
144146
"""

0 commit comments

Comments
 (0)
Please sign in to comment.