From 0d83919eaa08a342a2069f3ac80ce23bb2be7be3 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Thu, 27 Aug 2015 14:13:57 +0100 Subject: [PATCH] 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. --- History.md | 5 +++++ lib/selectors/simple.js | 2 +- test/selectors/simple-test.js | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) 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']] ] }) ) -- 2.34.1