From: Jakub Pawlowicz Date: Thu, 27 Aug 2015 13:13:57 +0000 (+0100) Subject: Fixes #652 - order of restoring and removing unused tokens. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=0d83919eaa08a342a2069f3ac80ce23bb2be7be3;p=clean-css.git Fixes #652 - order of restoring and removing unused tokens. We should first restore token and then remove unused tokens as this way the positions don't get mangled. --- diff --git a/History.md b/History.md index 5fdd0370..32eaa26b 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,8 @@ +[3.4.1 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.0...3.4) +================== + +* Fixed issue [#652](https://github.com/jakubpawlowicz/clean-css/issues/652) - order of restoring and removing tokens. + [3.4.0 / 2015-08-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.10...v3.4.0) ================== diff --git a/lib/selectors/simple.js b/lib/selectors/simple.js index 3e27e9d2..f43f6d21 100644 --- a/lib/selectors/simple.js +++ b/lib/selectors/simple.js @@ -348,8 +348,8 @@ function optimizeBody(properties, options) { minifyFont(property); } - removeUnused(_properties); restoreFromOptimizing(_properties, true); + removeUnused(_properties); } function cleanupCharsets(tokens) { diff --git a/test/selectors/simple-test.js b/test/selectors/simple-test.js index ceecce1f..41d9b591 100644 --- a/test/selectors/simple-test.js +++ b/test/selectors/simple-test.js @@ -369,6 +369,10 @@ vows.describe('simple optimizations') 'bang': [ 'a{color:red !ie}', null + ], + 'before content': [ + 'a{*width:101px;color:red!important}', + [['color', 'red!important']] ] }) )