Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: remove unused CSS #search { position: relative } #101624

Merged
merged 2 commits into from
Sep 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
@@ -596,10 +596,6 @@ h2.location a {
margin: 0;
}

#search {
position: relative;
}

.search-loading {
text-align: center;
}
@@ -977,7 +973,6 @@ so that we can apply CSS-filters to change the arrow color in themes */

.search-results > a {
display: block;
width: 100%;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is slight display change with this one as the results seem less wide but the result looks good to me so all good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I cloned the commit when this was introduced, built the ancient version of rustdoc, and tried removing it. The commit — ee7cc63 — that added this rule claims that it fixed a bug, but it never says what the bug was, there's no screenshot, and I can't actually find anything truly broken when I remove it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see it in the issue linked in the PR: #85544

/* A little margin ensures the browser's outlining of focused links has room to display. */
margin-left: 2px;
margin-right: 2px;
4 changes: 2 additions & 2 deletions src/test/rustdoc-gui/search-result-display.goml
Original file line number Diff line number Diff line change
@@ -7,11 +7,11 @@ press-key: 'Enter'
wait-for: "#crate-search"
// The width is returned by "getComputedStyle" which returns the exact number instead of the
// CSS rule which is "50%"...
assert-css: (".search-results div.desc", {"width": "295px"})
assert-css: (".search-results div.desc", {"width": "293px"})
size: (600, 100)
// As counter-intuitive as it may seem, in this width, the width is "100%", which is why
// when computed it's larger.
assert-css: (".search-results div.desc", {"width": "570px"})
assert-css: (".search-results div.desc", {"width": "566px"})

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