Skip to content

Conversation

@huonw
Copy link
Contributor

@huonw huonw commented Sep 6, 2014

Sometimes (e.g. on Rust CI) the "expand description" text of the
collapse toggle was displayed by default, when a page is first
loaded (even though the description is expanded), because some
Content-Security-Policy settings disable inline CSS.

Setting it the style with the .css method allows the output to be used
in more places.

@huonw
Copy link
Contributor Author

huonw commented Sep 6, 2014

e.g. http://www.rust-ci.org/huonw/slow_primes/doc/slow_primes/ has the Expand description text lying on top of the main description.

I can't actually reproduce the issue locally, as it only seems to crop up on Rust CI, but manually inserting this new JS into the page fixes the issue (and manually inserting the old JS in the same manner fails the same as it used to).

@lilyball
Copy link
Contributor

lilyball commented Sep 6, 2014

This isn't a jQuery issue. The issue is the Content-Security-Policy being returned by rust-ci.org:

Content-Security-Policy=default-src 'none'; script-src 'unsafe-inline' 'self'; font-src http://themes.googleusercontent.com 'self'; style-src http://fonts.googleapis.com 'self';

Specifically, it doesn't include 'unsafe-inline' in the style-src list, so inline style attributes/tags are ignored.

@huonw
Copy link
Contributor Author

huonw commented Sep 6, 2014

Oh I see. In any case, this patch does fix it, so I'll edit the commit message.

@lilyball
Copy link
Contributor

lilyball commented Sep 6, 2014

Which is to say, we should probably tell rust-ci that they should add 'unsafe-inline' to the style-src CSP.

Sometimes (e.g. on Rust CI) the "expand description" text of the
collapse toggle was displayed by default, when a page is first
loaded (even though the description is expanded), because some
Content-Security-Policy settings disable inline CSS.

Setting it the style with the `.css` method allows the output to be used
in more places.
@huonw huonw changed the title Use more jQuery to avoid displaying Expand Description in some Use more jQuery to avoid displaying Expand Description more often. Sep 6, 2014
@lilyball
Copy link
Contributor

lilyball commented Sep 6, 2014

I just emailed Hans Jørgen Hoel about the CSP issue.

bors added a commit that referenced this pull request Sep 7, 2014
Sometimes (e.g. on Rust CI) the "expand description" text of the
collapse toggle was displayed by default, when a page is first
loaded (even though the description is expanded), because some
Content-Security-Policy settings disable inline CSS.

Setting it the style with the `.css` method allows the output to be used
in more places.
@bors bors closed this Sep 7, 2014
@bors bors merged commit 9151874 into rust-lang:master Sep 7, 2014
@huonw huonw deleted the moar-jquery branch September 9, 2014 04:20
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, nice catch.

lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Run Windows tests on PRs too

Previously PRs would only do a build on Windows, which confusingly meant that PRs got a green tick for Windows despite not testing them.

See discussion in rust-lang#17019.
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
Run Windows tests on PRs too

Previously PRs would only do a build on Windows, which confusingly meant that PRs got a green tick for Windows despite not testing them.

See discussion in rust-lang#17019.
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.

5 participants