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

Prevent usage of .stab elements to create scrollable areas in doc blocks #102100

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

GuillaumeGomez
Copy link
Member

Fixes #101874.

You can test it online here.

r? @notriddle

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Sep 21, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 21, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 21, 2022
@GuillaumeGomez GuillaumeGomez changed the title Prevent usage of .stab elements to create scrollable ares in doc blocks Prevent usage of .stab elements to create scrollable areas in doc blocks Sep 21, 2022
// 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"},
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of hard coding the number 502, would it be better to create a fourth paragraph, with no stab tags in it, and use compare-elements-property to assert that they all have the same scroll width?

Copy link
Member Author

Choose a reason for hiding this comment

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

That wouldn't be "accurate" as for whatever reasons the size could be different. What I'm currently working on is adding support for variables in browser-ui-test so we can instead directly store either scroll* or client* and then compare to the other ones, so no need for raw numbers like this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created the issue so you can have an idea of what it will look like: GuillaumeGomez/browser-UI-test#351

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, that makes sense.

@GuillaumeGomez
Copy link
Member Author

Fixed the formatting and the invalid CSS selector.

@GuillaumeGomez
Copy link
Member Author

Ah the CI finally restarted.

@GuillaumeGomez
Copy link
Member Author

CI passed \o/

@notriddle
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 21, 2022

📌 Commit 6069f71 has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 21, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2022
Rollup of 12 pull requests

Successful merges:

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

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9aa3180 into rust-lang:master Sep 22, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 22, 2022
@GuillaumeGomez GuillaumeGomez deleted the stab-in-docblocks branch September 22, 2022 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve styling of <span class="stab"> tags in the documentation's main body
5 participants