crowell / modpagespeed_tmp

Automatically exported from code.google.com/p/modpagespeed
Apache License 2.0
0 stars 0 forks source link

CSS selector broken by removing quote #575

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r2239.

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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Thanks.

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

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
Shawn can you look at this again?

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

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
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 commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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 commented 9 years ago
No problem, thanks for the report and verification.

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