Skip to content

Commit 30d8953

Browse files
committed
8275889: Search dialog has redundant scrollbars
Reviewed-by: jjg
1 parent cee54de commit 30d8953

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@ private Comment getGeneratedBy(boolean timestamp, ZonedDateTime buildDate) {
319319
}
320320

321321
private void addStylesheets(HtmlTree head) {
322+
if (index) {
323+
// Add JQuery-UI stylesheet first so its rules can be overridden.
324+
addStylesheet(head, DocPaths.RESOURCE_FILES.resolve(DocPaths.JQUERY_UI_CSS));
325+
}
326+
322327
if (mainStylesheet == null) {
323328
mainStylesheet = DocPaths.STYLESHEET;
324329
}
@@ -332,10 +337,6 @@ private void addStylesheets(HtmlTree head) {
332337
// Local stylesheets are contained in doc-files, so omit resource-files prefix
333338
addStylesheet(head, path);
334339
}
335-
336-
if (index) {
337-
addStylesheet(head, DocPaths.RESOURCE_FILES.resolve(DocPaths.JQUERY_UI_CSS));
338-
}
339340
}
340341

341342
private void addStylesheet(HtmlTree head, DocPath stylesheet) {

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,27 +692,31 @@ nav {
692692
/*
693693
* Styles for javadoc search.
694694
*/
695-
.ui-state-active {
695+
.ui-menu .ui-state-active {
696696
/* Overrides the color of selection used in jQuery UI */
697697
background: var(--selected-background-color);
698-
border: 1px solid var(--selected-background-color);
699698
color: var(--selected-text-color);
699+
/* Workaround for browser bug, see JDK-8275889 */
700+
margin: -1px 0;
701+
border-top: 1px solid var(--selected-background-color);
702+
border-bottom: 1px solid var(--selected-background-color);
700703
}
701704
.ui-autocomplete-category {
702705
font-weight:bold;
703706
font-size:15px;
704707
padding:7px 0 7px 3px;
705708
background-color:var(--navbar-background-color);
706709
color:var(--navbar-text-color);
710+
box-sizing: border-box;
707711
}
708712
.ui-autocomplete {
709713
max-height:85%;
710714
max-width:65%;
711715
overflow-y:auto;
712716
overflow-x:auto;
713-
scrollbar-width: thin;
714717
white-space:nowrap;
715718
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
719+
overscroll-behavior: contain;
716720
}
717721
ul.ui-autocomplete {
718722
position:fixed;
@@ -723,6 +727,7 @@ ul.ui-autocomplete li {
723727
float:left;
724728
clear:both;
725729
min-width:100%;
730+
box-sizing: border-box;
726731
}
727732
ul.ui-autocomplete li.ui-static-link {
728733
position:sticky;
@@ -747,6 +752,10 @@ li.ui-static-link a, li.ui-static-link a:visited {
747752
.ui-autocomplete .result-highlight {
748753
font-weight:bold;
749754
}
755+
.ui-menu .ui-menu-item-wrapper {
756+
padding-top: 0.4em;
757+
padding-bottom: 0.4em;
758+
}
750759
#search-input, #page-search-input {
751760
background-image:url('glass.png');
752761
background-size:13px;

test/langtools/jdk/javadoc/doclet/checkStylesheetClasses/CheckStylesheetClasses.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ void run() throws Exception {
137137
// used in search.js and search-page.js; may be worth documenting in HtmlStyle
138138
removeAll(styleSheetNames, "result-highlight", "result-item", "anchor-link",
139139
"search-tag-desc-result", "search-tag-holder-result", "page-search-header",
140-
"ui-autocomplete", "ui-autocomplete-category", "ui-state-active", "expanded",
141-
"search-result-link", "two-column-search-results", "ui-static-link",
142-
"sort-asc", "sort-desc", "visible");
140+
"ui-autocomplete", "ui-autocomplete-category", "ui-state-active", "ui-menu",
141+
"ui-menu-item-wrapper", "ui-static-link", "expanded", "search-result-link",
142+
"two-column-search-results", "sort-asc", "sort-desc", "visible");
143143

144144
// very JDK specific
145145
styleSheetNames.remove("module-graph");

0 commit comments

Comments
 (0)