-
Notifications
You must be signed in to change notification settings - Fork 11
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
HTML Compressor does not ignore <noscript> tags #65
Comments
Thanks for the report! Yes, that does sound like a bug. |
cc @raamdev Something to be aware of. |
Steps to reproduce this bug
Observed BehaviorThe slideshow does not load as expected because the CSS inside the In the case of the Portfolio Slideshow plugin, that CSS disables the main features of the Portfolio Slideshow plugin because those features require JavaScript. Since that CSS is being loaded even for browsers with JavaScript Enabled, those browsers will see the Slideshow as if they were visiting with JavaScript Disabled. Expected BehaviorThe content inside the Other NotesWhen I select No, do not combine CSS from and into fewer files. in the HTML Compressor, the contents of the Here's the contents of the <noscript><link rel="stylesheet" type="text/css" href="http://zcpro.dev/wordpress/wp-content/plugins/portfolio-slideshow-1.5.1/css/portfolio-slideshow-noscript.css?ver=1.5.1" /></noscript> And here's what that same line looks like after ZenCache strips out that CSS: <noscript></noscript> |
Please note also, if CSS combining is enabled but the stylesheet in question is added to the CSS Exclusion Patterns, the noscript tags are stripped from the original HTML and the stylesheet still loads unconditionally. |
Next Release Changelog:
|
ZenCache Pro v151002 has been released and includes changes from this GitHub Issue. See the ZenCache Pro v151002 release announcement for further details. This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#65). |
The noscript tag can be used to load stylesheets for use when javascript is disabled. The HTML compressor combines these stylesheets with other stylesheets, which results in them being loaded always instead of only when javascript is disabled. This seems to be incorrect behavior.
For an example, install the Portfolio Slideshow plugin in WordPress. Notice that is loads a stylesheet named portfolio-slideshow-noscript.css when javascript is disabled. With HTML compression enabled and CSS combining enabled, this stylesheet becomes part of a combined stylesheet and the slideshow navigation and pager are always hidden. With HTML compression enabled but CSS combining disabled, this stylesheet remains correctly within a noscript tag and does not load unless javascript is disabled. Adding an exclusion for noscript leaves the stylesheet uncombined but removes the noscript tag, so it still loads incorrectly when javascript is enabled.
The text was updated successfully, but these errors were encountered: