minify css causes problem (or highlights bug) with calc() in chrome
-
Hi there,
hope you are all well.
I encountered a very peculiar bug whilst testing SG Optimizer very recently.
I believe this is a parsing bug that affects Chrome and webkit-based browsers.Please Note: This is a Chrome parsing bug, but you should be aware of it.
The CSS minification algorithm of SG Optimizer results in the alteration of a some of css statements in our code
Specifically
z-index: calc(var(………) + 1000);
becomes
z-index: calc(var(………) + 1e3);This saves 1 byte Chrome (and other webkit based browsers) is unable to parse this.
the value of z-index then reverts to auto with consequences.– The issue only affects Chrome, in particular desktop Chrome.
– changing ‘+ 1000’ to ‘+ 999’ (or ‘+ 2000’ to + 1999) in our code results in the css minification leaving this and similar css entries alone.
– Chrome is able to parse 1e3px (a minified version of 1000px)
– Chrome is unable to parse / understand “z-index: 1e3;” (flags the entry as invalid) but understands “width: 1e3px;”This is a very small issue, that can have large consequences.
We have elected to ( hopefully temporally ) remove the specific css file (containing the statement above) from minification.
Not sure who should flag this bug on the chromium bug forums.
Any suggestions?Cheers
Giacomo Bruzzo
- The topic ‘minify css causes problem (or highlights bug) with calc() in chrome’ is closed to new replies.