Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

CSS selector broken by removing quote #575

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

CSS selector broken by removing quote #575

GoogleCodeExporter opened this issue Apr 6, 2015 · 14 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

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

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r2239.

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

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

Thanks.

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

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

Shawn can you look at this again?

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant