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

CSS selector broken by removing quote #575

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 14 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Apr 6, 2015

From joyce@joycebabu.com:

I am using Bootstrap CSS framework from Twitter for my site. I just noticed 
that bootstrap is breaking some of my css by removing quotes from CSS selectors

Bootstrap uses the following CSS selector for elements with classes beginning 
with icon- prefix

[class^="icon-"],[class*=" icon-"]

ModPagespeed optimizes this into 

[class^=icon-],[class*= icon-]

After this change, Firefox ignores the leading whitespace and starts matching 
classes like thumbnails-icon-list.

Original issue reported on code.google.com by jmara...@google.com on 25 Nov 2012 at 4:45

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by sligocki@google.com on 27 Nov 2012 at 12:20

  • Changed state: Started
  • Added labels: Milestone-v24
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

This issue was closed by revision r2239.

Original comment by sligocki@google.com on 30 Nov 2012 at 8:43

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Just submitted a change that should fix this. It will be in the next release, 
coming soon.

Original comment by sligocki@google.com on 30 Nov 2012 at 8:46

  • Added labels: release-note
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks.

Original comment by jo...@joycebabu.com on 1 Dec 2012 at 5:14

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Unfortunately, this issue still exists in r2258. My original css: 

#radiolist input[value="0"]:checked + label {}
#radiolist input[value="1"]:checked + label {}
#radiolist input[value="2"]:checked + label {}

was minimised into this:

#radiolist input[value=0]:checked+label{}#radiolist 
input[value=1]:checked+label{}#radiolist input[value=2]:checked+label{}

which make webkit ignore them entirely.

Original comment by b1nhb0...@gmail.com on 5 Dec 2012 at 11:13

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Shawn can you look at this again?

Original comment by jmara...@google.com on 5 Dec 2012 at 2:12

  • Changed state: Accepted
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Original comment by sligocki@google.com on 5 Dec 2012 at 2:44

  • Changed state: Started
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

This is working correctly for me at r2258.

It compresses:

#radiolist input[value="0"]:checked + label {}
#radiolist input[value="1"]:checked + label {}
#radiolist input[value="2"]:checked + label {}

to:

#radiolist input[value="0"]:checked+label{}#radiolist 
input[value="1"]:checked+label{}#radiolist input[value="2"]:checked+label{}

Can you try clearing your cache? (See 
https://developers.google.com/speed/docs/mod_pagespeed/system#flush_cache)

Could you also try using css_minify_main on that file? (See 
https://developers.google.com/speed/docs/mod_pagespeed/build_from_source#debug-c
ss, but don't pipe the results to /dev/null)

Original comment by sligocki@google.com on 5 Dec 2012 at 3:08

  • Changed state: RequestClarification
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Still no luck. Steps taken:

- Cache cleared, even purged and reinstalled 
"mod-pagespeed-beta_1.1.23.2-r2258_i386.deb" (self-built).
- css_minify_main (thanks for this, btw, didn't notice it exists!) still 
produces the same result (unquoted values).

Original comment by b1nhb0...@gmail.com on 6 Dec 2012 at 12:45

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

I've came up with a work-around for now by selecting the "id" instead 
(#radiolist input[id=value_1]). Webkit doesn't care if its value is quoted in 
this instance.

Original comment by b1nhb0...@gmail.com on 6 Dec 2012 at 2:29

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

What branch do you have checked out? You should be checking out from "trunk" 
using:

gclient config http://modpagespeed.googlecode.com/svn/trunk/src

the "bleeding edge" version from 
https://developers.google.com/speed/docs/mod_pagespeed/build_from_source .

It looks like you are checking out the latest-beta instead, which does not have 
any changes since our last release. If you build from trunk, I think your 
version will be something like 1.1.0.0-r2258

Original comment by sligocki@google.com on 6 Dec 2012 at 4:46

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Marking as fixed since Shawn's pretty confident it is and the OP hasn't replied.
The fix will be in the forthcoming 1.1.24.x release.

Original comment by matterb...@google.com on 6 Dec 2012 at 9:58

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

Thanks, tested from trunk and worked as described. Sorry for the confusion.

Original comment by b1nhb0...@gmail.com on 7 Dec 2012 at 8:23

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Apr 6, 2015

No problem, thanks for the report and verification.

Original comment by sligocki@google.com on 7 Dec 2012 at 7:30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment