[dev] CSS Parsing class

Michael M Slusarz slusarz at horde.org
Thu Mar 21 20:22:25 UTC 2013


Quoting Rui Carneiro <rui.carneiro at portugalmail.net>:

> *Original:*
> 1- box-shadow:0 3px 4px rgba(0,0,0,0.4);
> 2- opacity:0.7;
> 3- line-height:1.2em;
> 4-
> filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f4f6',endColorstr='#e1e2e5',GradientType=0);
> 5- margin: 23px 3px 0 8px;

It looks like there is an issue with locale conversions.  Not a big  
deal.  Can probbably be fixed in a few seconds.  Guessing it's an  
issue with a floatval() call not being made locale independent.

And #4 is definitely NOT supported.   It is not supported by current  
csstidy either.  If it worked previously that was **entirely** by  
chance, but this is not a critical issue since it only affects IE8,  
which we are not actively theme supporting anymore (IE8 is in "do  
enough to make it work, but there is no expectation that advanced CSS  
features will work" stage).

> *After parse and compress:*
> 1- box-shadow:0 3px 4px rgba(0,0,0,0,4);
> 2- opacity:0;
> 3- line-height:1em;
> 4- No output
> 5- margin:23px 3px 0 0;
>
> These are some cases I found on the login page ONLY. There is also some CSS
> rules that disappear and I have no
> idea why (maybe some optimizer?) In my opinion this PHP-CSS-Parser is also
> broken.
>
> Why don't you just let this new parser thing be a config like the old
> $conf['cachecssparams']['compress']?

Because you **cannot** make it optional.  If using caching, you are  
moving css files to a different relative location on the server.  As  
such, we absolutely HAVE to 1) parse/translate relative URLs and 2)  
parse import statements.  Period.  Neither of these works correctly  
with csstidy.  Period.  So we need some kind of parser to do this  
correctly.

If you are not comfortable with this, you need to disable caching.   
There is no other option.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list