about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-22 01:41:03 +0000
committerbors <bors@rust-lang.org>2022-09-22 01:41:03 +0000
commit626b02a8f97a9e35a647aa18fcdb67cbcb3b09c8 (patch)
treee22193ef46205ca9429e757fcd508cbe7eb9dd2f /src/test/rustdoc-gui
parent4a4fd12ebfd01d969a719e5c43c2e318441e827b (diff)
parent15b4788e36a5ca55380cc88483a9a20198a5a381 (diff)
Auto merge of #102121 - JohnTitor:rollup-3fb1wrt, r=JohnTitor
Rollup of 12 pull requests

Successful merges:

 - #101952 (Avoid panicking on missing fallback)
 - #102030 (Don't crate-locally reexport walk functions in tidy)
 - #102032 (Adding ignore fuchsia tests for signal interpretation cases)
 - #102033 (Adding needs-unwind to nicer-assert-messages compiler ui tests)
 - #102054 (Unify "all items" page's sidebar with other pages)
 - #102071 (Adding needs-unwind for tests testing memory size of Futures/Closures)
 - #102073 (Adding ignore fuchsia tests for execvp)
 - #102075 (rustdoc: remove no-op CSS `.content > .methods > .method`)
 - #102079 (Update books)
 - #102084 (Adding needs-unwind for test using panic::catch_unwind)
 - #102100 (Prevent usage of .stab elements to create scrollable areas in doc blocks)
 - #102102 (Add doc aliases on Sized trait)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/check-stab-in-docblock.goml21
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs18
2 files changed, 39 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/check-stab-in-docblock.goml b/src/test/rustdoc-gui/check-stab-in-docblock.goml
new file mode 100644
index 00000000000..7f965ada594
--- /dev/null
+++ b/src/test/rustdoc-gui/check-stab-in-docblock.goml
@@ -0,0 +1,21 @@
+// This test checks that using `.stab` attributes in `.docblock` elements doesn't
+// create scrollable paragraphs.
+goto: file://|DOC_PATH|/test_docs/index.html
+// Needs the text to be display to check for scrollable content.
+show-text: true
+size: (786, 600)
+// Confirms that there 3 paragraphs.
+assert-count: (".top-doc .docblock p", 3)
+// Checking that there is no scrollable content.
+assert-property: (
+    ".top-doc .docblock p:nth-of-type(1)",
+    {"scrollHeight": "120", "clientHeight": "120", "scrollWidth": "502", "clientWidth": "502"},
+)
+assert-property: (
+    ".top-doc .docblock p:nth-of-type(2)",
+    {"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
+)
+assert-property: (
+    ".top-doc .docblock p:nth-of-type(3)",
+    {"scrollHeight": "48", "clientHeight": "48", "scrollWidth": "502", "clientWidth": "502"},
+)
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index e6177ff84b4..1c066206c1f 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -6,6 +6,24 @@
 #![feature(rustdoc_internals)]
 #![feature(doc_cfg)]
 
+/*!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+
+Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
+</span>.
+Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
+</span>.
+*/
+
 use std::convert::AsRef;
 use std::fmt;