jianlinwei / cssmin

Automatically exported from code.google.com/p/cssmin
0 stars 0 forks source link

expression() declaration values triggers unterminated declaration property error #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I report 2 bugs detected when update the cssmin library in my project SaltOS:
=============================================================================

PHP Error
=========
array_combine(): Both parameters should have at least 1 element (code 2)

Details
=======
Error on file '/home/sanz/workspace/saltos/code/lib/cssmin/cssmin-v2.0.2.php' 
at line 595

Fixed with
==========
if(count($config)) $config = array_combine(array_map("trim", 
array_map("strtolower", array_keys($config))), array_values($config));

URL test
========
https://localhost.localdomain/saltos/code/xml.php?action=cache&files=lib/jqu
ery/jquery.tooltip.css,lib/jquery/jquery.colorpicker.css,lib/jquery/jquery.ptTim
eSelect.css,lib/jquery/jquery.jgrowl.css,&r=3657

=============================================================================

PHP Error
=========
Line #17: Unterminated declaration: left: expression( ( 0 - jGrowl.offsetWidth 
+ ( document.documentElement.clientWidth ? document.documentElement.clientWidth 
: document.body.clientWidth ) + ( ignoreMe2 = 
document.documentElement.scrollLeft ? document.documentElement.scrollLeft : 
document.body.scrollLeft ) ) + 'px' );_ (code 512)

Details
=======
Error on file '/home/sanz/workspace/saltos/code/lib/cssmin/cssmin-v2.0.2.php' 
at line 1581

Comments
========
I don't know how fix this bug because the problem is related to the parser (and 
it's a lot of complex!!!). I attach the CSS file that cause the problem. The 
minify is called without a config argument (non used to force the default 
configuration).

URL test
========
https://localhost.localdomain/saltos/code/xml.php?action=cache&files=lib/jqu
ery/jquery.jgrowl.css,&r=3657

=============================================================================

Josep Sanz
SaltOS Team

Original issue reported on code.google.com by josepsan...@gmail.com on 17 Feb 2011 at 9:28

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for reporting this bugs.

Original comment by joe.scylla on 18 Feb 2011 at 8:14

GoogleCodeExporter commented 9 years ago
Fixed in version 2.0.2.1.

The expression parsing is more kind of temporary fix. There are no semicolor 
and right curly brace allowed in the expression value except if they are 
escaped in a string.

While right curly braces are allowed in expression values nobody should use 
them because they will break the css parsing of other browsers than IE. 

Semicolons are more of a problem as they are also allowed in a expression value 
and they can get used like in --> content: expression(Math.random();) <--. 
Semicolon used that way will break the parsing and i won't fix this in version 
2.x.

I will try to implement a stable expression value parser in version 3.x.

Original comment by joe.scylla on 18 Feb 2011 at 10:02

GoogleCodeExporter commented 9 years ago
Hi.

I updated the cssmin library and work as expected now. Thanks for your quick 
response and fix.

Josep Sanz
saltos.net

Original comment by josepsan...@gmail.com on 18 Feb 2011 at 12:47