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 redundant CSS selector .notable-traits .notable #103592

Merged
merged 2 commits into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ h3.variant {
content: "\00a0\00a0\00a0";
}

.notable-traits .notable, .notable-traits .docblock {
.notable-traits .docblock {
margin: 0;
}

Expand Down
39 changes: 38 additions & 1 deletion src/test/rustdoc-gui/notable-trait.goml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,23 @@ assert-position: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
{"x": 951},
)

// The tooltip should be beside the `i`
click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
compare-elements-position-near: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
{"y": 2}
)
compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
("x")
)
// The docblock should be flush with the border.
assert-css: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
{"margin-left": "0px"}
)

// Now only the `i` should be on the next line.
size: (1055, 600)
Expand Down Expand Up @@ -81,6 +97,27 @@ assert-position: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
{"x": 289},
)
// The tooltip should be below `i`
compare-elements-position-near-false: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
{"y": 2}
)
compare-elements-position-false: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
("x")
)
compare-elements-position-near: (
"//*[@id='method.create_an_iterator_from_read']/parent::*",
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
{"x": 5}
)
// The docblock should be flush with the border.
assert-css: (
"//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
{"margin-left": "0px"}
)

// Checking on very small mobile. The `i` should be on its own line.
size: (365, 600)
Expand Down