From 5637e894fd813a178c2d693c2b060c24848e09c1 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Thu, 2 Jun 2016 07:29:47 +0200 Subject: [PATCH] Fixes #781 - regression in override compacting. Checking every combination of override clashes should not fall back to same values in case of multiplex components. --- History.md | 5 +++++ lib/properties/every-combination.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 1e9b6253..93f88085 100644 --- a/History.md +++ b/History.md @@ -3,6 +3,11 @@ * Requires Node.js 4.0+ to run. +[3.4.16 / 2016-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.15...3.4) +================== + +* Fixed issue [#781](https://github.com/jakubpawlowicz/clean-css/issues/781) - regression in override compacting. + [3.4.15 / 2016-06-01](https://github.com/jakubpawlowicz/clean-css/compare/v3.4.14...v3.4.15) ================== diff --git a/lib/properties/every-combination.js b/lib/properties/every-combination.js index 61495979..be3faa69 100644 --- a/lib/properties/every-combination.js +++ b/lib/properties/every-combination.js @@ -3,7 +3,7 @@ var shallowClone = require('./clone').shallow; var MULTIPLEX_SEPARATOR = ','; function everyCombination(fn, left, right, validator) { - var samePositon = !left.shorthand && !right.shorthand; + var samePositon = !left.shorthand && !right.shorthand && !left.multiplex && !right.multiplex; var _left = shallowClone(left); var _right = shallowClone(right); diff --git a/test/properties/override-compacting-test.js b/test/properties/override-compacting-test.js index 8765818e..1e039c26 100644 --- a/test/properties/override-compacting-test.js +++ b/test/properties/override-compacting-test.js @@ -210,6 +210,15 @@ vows.describe(optimize) ]); } }, + 'shorthand then multiplex longhand - non mergeable value': { + 'topic': 'p{background:#fff;background-image:__ESCAPED_URL_CLEAN_CSS0__,linear-gradient()}', + 'into': function (topic) { + assert.deepEqual(_optimize(topic), [ + [['background'], ['#fff']], + [['background-image'], ['__ESCAPED_URL_CLEAN_CSS0__'], [','], ['linear-gradient()']] + ]); + } + }, 'shorthand then longhand - border with rgba() and color opacity on': { 'topic': 'p{border:solid rgba(0,0,0,0);border-color:transparent}', 'into': function (topic) { -- 2.34.1