Fixes #781 - regression in override compacting.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 2 Jun 2016 05:29:47 +0000 (07:29 +0200)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 2 Jun 2016 09:16:29 +0000 (11:16 +0200)
Checking every combination of override clashes should not fall
back to same values in case of multiplex components.

History.md
lib/properties/every-combination.js
test/properties/override-compacting-test.js

index 1e9b625..93f8808 100644 (file)
@@ -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)
 ==================
 
index 6149597..be3faa6 100644 (file)
@@ -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);
 
index 8765818..1e039c2 100644 (file)
@@ -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) {