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

Fix rustdoc display with js disabled #64994

Merged

Conversation

GuillaumeGomez
Copy link
Member

Fixes #64988.

Currently, all sections are collapsed when the page is loading, and then is displayed once done. However, if js is disabled, they never get expanded. Therefore, they need to be shown by default.

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

Hm, so what performance effect does this have? I'd expect the browser to be able to cope better with the page loading when everything is display: none; rather than being shown.

@the8472
Copy link
Member

the8472 commented Oct 2, 2019

Browsers ignore the CSS nested in <noscript> so it shouldn't have any effect on rendering when JS is enabled.

That said, as mentioned in the associated issue I think <details> <summary> would be a more noscript-friendly solution.

@Mark-Simulacrum
Copy link
Member

Ah, I missed that this was noscript-specific. (It would be great to clarify that in the PR description...)

I think using details/summary is a longer-term refactor and likely comes with a much larger patch. I'm personally inclined to just land this.

@GuillaumeGomez
Copy link
Member Author

I answered to why I think details and summary aren't a suitable solution for the moment. It might later on when we drop IE9 support but we can't use it for the moment.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 4, 2019

📌 Commit de961a7 has been approved by Mark-Simulacrum

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 4, 2019
@bors
Copy link
Contributor

bors commented Oct 4, 2019

⌛ Testing commit de961a7 with merge 2e72448...

bors added a commit that referenced this pull request Oct 4, 2019
…, r=Mark-Simulacrum

Fix rustdoc display with js disabled

Fixes #64988.

Currently, all sections are collapsed when the page is loading, and then is displayed once done. However, if js is disabled, they never get expanded. Therefore, they need to be shown by default.

r? @Mark-Simulacrum
@bors
Copy link
Contributor

bors commented Oct 4, 2019

☀️ Test successful - checks-azure
Approved by: Mark-Simulacrum
Pushing 2e72448 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 4, 2019
@bors bors merged commit de961a7 into rust-lang:master Oct 4, 2019
@GuillaumeGomez GuillaumeGomez deleted the fix-rustdoc-display-js-disabled branch October 4, 2019 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad page rendering with js disabled
4 participants