diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-10-27 09:25:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-27 09:25:11 +0200 |
| commit | 29698dc38a4dc7d5437395c9721a47f37ab65a8c (patch) | |
| tree | 06590437aa301379ac59e35cedb6e1535450a217 | |
| parent | bf53e712c0243b604f9c7a99bb518d5f6ef3afc0 (diff) | |
| parent | a7a0b360a8f7dc2e7b942cad2cbf8b9a145e20aa (diff) | |
| download | rust-29698dc38a4dc7d5437395c9721a47f37ab65a8c.tar.gz rust-29698dc38a4dc7d5437395c9721a47f37ab65a8c.zip | |
Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, r=GuillaumeGomez
rustdoc: remove redundant CSS selector `.notable-traits .notable` The margin was already being set to 0 only a few lines lower.
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/notable-trait.goml | 39 |
2 files changed, 39 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index b60c7719563..5a1a6c0f0f9 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1293,7 +1293,7 @@ h3.variant { content: "\00a0\00a0\00a0"; } -.notable-traits .notable, .notable-traits .docblock { +.notable-traits .docblock { margin: 0; } diff --git a/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml index 997fb5cf0ad..efe0cb15f08 100644 --- a/src/test/rustdoc-gui/notable-trait.goml +++ b/src/test/rustdoc-gui/notable-trait.goml @@ -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) @@ -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) |
