From 306a11f4be1e0bc3f49da0cb6154a9b591e3908d Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Fri, 8 May 2015 09:46:48 +0100 Subject: [PATCH] Fixes #567 - regression in function color merging. Having two colors are functions resulted in a incorect call to a function checking if two colors are same function or not. --- History.md | 5 +++++ lib/properties/can-override.js | 2 +- test/properties/override-compacting-test.js | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 43891cbb..3d56d10c 100644 --- a/History.md +++ b/History.md @@ -13,6 +13,11 @@ * Fixed issue [#517](https://github.com/jakubpawlowicz/clean-css/issues/517) - turning off color optimizations. * Fixed issue [#542](https://github.com/jakubpawlowicz/clean-css/issues/542) - space after closing brace in IE. +[3.2.9 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.8...3.2) +================== + +* Fixed issue [#567](https://github.com/jakubpawlowicz/clean-css/issues/567) - merging colors as functions. + [3.2.8 / 2015-05-04](https://github.com/jakubpawlowicz/clean-css/compare/v3.2.7...v3.2.8) ================== diff --git a/lib/properties/can-override.js b/lib/properties/can-override.js index 5d0555a4..88857d70 100644 --- a/lib/properties/can-override.js +++ b/lib/properties/can-override.js @@ -53,7 +53,7 @@ function color(property1, property2, validator) { return false; // Functions with the same name can override each other; same values can override each other - return sameFunctionOrValue(property1, property2); + return sameFunctionOrValue(property1, property2, validator); } function twoOptionalFunctions(property1, property2, validator) { diff --git a/test/properties/override-compacting-test.js b/test/properties/override-compacting-test.js index b90bea86..7159db23 100644 --- a/test/properties/override-compacting-test.js +++ b/test/properties/override-compacting-test.js @@ -31,6 +31,15 @@ function _optimize(source, compatibility, aggressiveMerging) { vows.describe(optimize) .addBatch({ + 'longhand then longhand - background colors as functions': { + 'topic': 'p{background-color:-ms-linear-gradient(top,red,#000);background-color:linear-gradient(top,red,#000)}', + 'into': function (topic) { + assert.deepEqual(_optimize(topic), [ + [['background-color', false , false], ['-ms-linear-gradient(top,red,#000)']], + [['background-color', false , false], ['linear-gradient(top,red,#000)']] + ]); + } + }, 'longhand then shorthand': { 'topic': 'p{background-image:none;background:__ESCAPED_URL_CLEAN_CSS0__}', 'into': function (topic) { -- 2.34.1