yanyiyi / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

IE6 bug - IE7-js breaks if CSS is minified #273

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Compress CSS using YUI CSS Compressor
2.Refresh site in IE6
3.BOOM, it's all gone wrong

What is the expected output? What do you see instead?
All formatting is lost.

What version of the product are you using? On what operating system?
IE9.js - but have also tried previous versions

Please provide any additional information below.
No other info.  But HUGE thumbs up on the fantastic work you're doing.

Original issue reported on code.google.com by jonrca...@gmail.com on 19 Aug 2010 at 12:12

GoogleCodeExporter commented 9 years ago
I have narrowed the issue down to this line in CssCompressor.java:

    css = css.replaceAll("([!{}:;>+\\(\\[,])\\s+", "$1");

In fact, reducing the regular expression to this:

    css = css.replaceAll("([{;])\\s+", "$1");

(with no other transformations) will reproduce the issue.

Original comment by adr...@gmail.com on 13 Dec 2010 at 8:14

GoogleCodeExporter commented 9 years ago
Thanks for your reply, sorry I haven't got back to you sooner.

While I haven't found a fix for this bug, I have found a workaround.  This has 
help you pin point the error.

Here is a snippet of the code that does not work:
html,body{height:100%;}body{background:#4d4d4d;color:#b8b8b8;font:.69em 
Arial,Helvetica,sans-serif;}h1{color:#fff;font-size:1.82em;}h1 
strong{color:#c2611e;}

Here is the same snippet tweaked so that it does work:
html,body{ height:100%;}body{ background:#4d4d4d;color:#b8b8b8;font:.69em 
Arial,Helvetica,sans-serif;}h1{ color:#fff;font-size:1.82em;}h1 strong{ 
color:#c2611e;}

You will notice that after every { there is a space.  It is this space that 
allows the css to be parsed.

Thanks,
Jon

Original comment by jonrca...@gmail.com on 1 Feb 2011 at 12:36

GoogleCodeExporter commented 9 years ago
Any updates on this? I've also encountered this bug when using IE8.js and the 
CSS compression in Drupal 6 together.

Original comment by djscorc...@gmail.com on 4 Mar 2011 at 5:08

GoogleCodeExporter commented 9 years ago
@jonrcarey Thanks for this workaround! It saved me lot of time debuging :)

Original comment by rafal.ga...@gmail.com on 6 Apr 2011 at 4:23

GoogleCodeExporter commented 9 years ago
In the minified version of IE9.js replace

i=A(i,K.media)}return i;

with

i=A(i,K.media)}return i.replace(/(\{)([a-zA-Z])/g,'{\n$2');

This will un-minify your CSS before parsing.

Tristan.

Original comment by t.breh...@yellmediaworks.com on 24 Aug 2011 at 2:15

GoogleCodeExporter commented 9 years ago
@t.breh...@yellmediaworks.com

I have tried this and can confirm that it works.  Thanks for the help!

Jon.

Original comment by jonrca...@gmail.com on 13 Sep 2011 at 10:17

GoogleCodeExporter commented 9 years ago
I still have this problem. Using Drupal 6 too...
I tried applying the workaround from #5 on 2.1(beta4) and it doesn't work.

Original comment by felipefi...@gmail.com on 26 Oct 2011 at 1:57

GoogleCodeExporter commented 9 years ago
Workaround works on IE9.js - Not sure which version... It contains: timestamp: 
Fri, 30 Apr 2010 20:59:18

Original comment by t.breh...@yellmediaworks.com on 26 Oct 2011 at 7:43

GoogleCodeExporter commented 9 years ago
Solution #5 helped. Thank you, Tristan.

Original comment by desig...@gmail.com on 27 Jan 2014 at 12:52