Skip to content

Commit 227e25a

Browse files
authored
Rollup merge of #101624 - notriddle:notriddle/search, r=GuillaumeGomez
rustdoc: remove unused CSS `#search { position: relative }` This was added in 611d0e6, to allow its child `#results` element to be absolutely positioned inside it. The child stopped being absolute in 8c04695. To keep the layout looking the same, the links need to not have `width: 100%` any more, relying instead on the box naturally growing to fit because it has `display: block`.
2 parents 27afe55 + 0698ffb commit 227e25a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/librustdoc/html/static/css/rustdoc.css

-5
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,6 @@ h2.location a {
592592
margin: 0;
593593
}
594594

595-
#search {
596-
position: relative;
597-
}
598-
599595
.search-loading {
600596
text-align: center;
601597
}
@@ -973,7 +969,6 @@ so that we can apply CSS-filters to change the arrow color in themes */
973969

974970
.search-results > a {
975971
display: block;
976-
width: 100%;
977972
/* A little margin ensures the browser's outlining of focused links has room to display. */
978973
margin-left: 2px;
979974
margin-right: 2px;

src/test/rustdoc-gui/search-result-display.goml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ press-key: 'Enter'
77
wait-for: "#crate-search"
88
// The width is returned by "getComputedStyle" which returns the exact number instead of the
99
// CSS rule which is "50%"...
10-
assert-css: (".search-results div.desc", {"width": "295px"})
10+
assert-css: (".search-results div.desc", {"width": "293px"})
1111
size: (600, 100)
1212
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
1313
// when computed it's larger.
14-
assert-css: (".search-results div.desc", {"width": "570px"})
14+
assert-css: (".search-results div.desc", {"width": "566px"})
1515

1616
// Check that the crate filter `<select>` is correctly handled when it goes to next line.
1717
// To do so we need to update the length of one of its `<option>`.

0 commit comments

Comments
 (0)