Skip to content

rustdoc: Fixed an asynchronous loading of rustdoc sidebars. #23146

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

Conversation

lifthrasiir
Copy link
Contributor

We require the deferred loading, not just an opportunistic asynchronous loading. (Yes, that was my oversight, as I only checked it locally...) I think <script defer> is safe to use, according to http://caniuse.com/#feat=script-defer.

We require the *deferred* loading, not just an opportunistic
asynchronous loading. I think `<script defer>` is safe to use,
according to <http://caniuse.com/#feat=script-defer>.
@rust-highfive
Copy link
Contributor

r? @steveklabnik

(rust_highfive has picked a reviewer for you, use r? to override)

@Manishearth
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 7, 2015

@bors r=Manishearth a3e4a16

@bors
Copy link
Collaborator

bors commented Mar 7, 2015

⌛ Testing commit a3e4a16 with merge b8c6eb1...

bors added a commit that referenced this pull request Mar 7, 2015
…hat-to-do-now, r=Manishearth

We require the *deferred* loading, not just an opportunistic asynchronous loading. (Yes, that was my oversight, as I only checked it locally...) I think `<script defer>` is safe to use, according to <http://caniuse.com/#feat=script-defer>.
@killercup
Copy link
Member

@lifthrasiir, why don't you insert the script tag for sidebar-items.js below the one for main.js?

If I read your code correctly, the position of the script tag is completely irrelevant to the rendering (you are not doing any document.write). The way you are doing it now depends on the fact that main.js was executed first, though. Thus, you need to use defer which would otherwise be unnecessary.

@lifthrasiir
Copy link
Contributor Author

@killercup Simply because we had no existing machinary to put such "deferred" scripts into the bottom. This commit is intended as the quickest fix; if we had several deferring scripts then we should really have to consider that though. (And multiple uses of <script defer> in IE 9 or earlier have some problem, IIRC.)

@bors
Copy link
Collaborator

bors commented Mar 7, 2015

@bors bors merged commit a3e4a16 into rust-lang:master Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants