From: Jakub Pawlowicz Date: Tue, 25 Aug 2015 07:10:57 +0000 (+0100) Subject: Refixes #629 - source maps & background shorthands. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=41f1238b91d05d8d68bdc4889b0206d6e4f472a1;p=clean-css.git Refixes #629 - source maps & background shorthands. --- diff --git a/History.md b/History.md index 6f5d1047..27f6c7f7 100644 --- a/History.md +++ b/History.md @@ -18,6 +18,7 @@ * Fixed issue [#644](https://github.com/jakubpawlowicz/clean-css/issues/644) - adds time unit optimizations. * Fixed issue [#645](https://github.com/jakubpawlowicz/clean-css/issues/645) - adds bottom to top `media` merging. * Fixed issue [#648](https://github.com/jakubpawlowicz/clean-css/issues/648) - adds property level at-rule support. +* Refixed issue [#629](https://github.com/jakubpawlowicz/clean-css/issues/629) - source maps & background shorthands. [3.3.9 / 2015-08-09](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.8...v3.3.9) ================== diff --git a/lib/properties/break-up.js b/lib/properties/break-up.js index 9bb49409..41e7e0ef 100644 --- a/lib/properties/break-up.js +++ b/lib/properties/break-up.js @@ -86,7 +86,7 @@ function background(property, compactable, validator) { } else if (i > 1 && values[i - 2] == '/') { size.value = [previousValue, value]; i -= 2; - } else if (values[i - 1] == '/') { + } else if (previousValue[0] == '/') { size.value = [value]; } else { if (!positionSet) diff --git a/test/source-map-test.js b/test/source-map-test.js index 6844846e..21bcfddc 100644 --- a/test/source-map-test.js +++ b/test/source-map-test.js @@ -44,6 +44,14 @@ vows.describe('source-map') assert.equal(minified.styles, 'a{background:#fff}'); } }, + 'background position and size': { + 'topic': function () { + return new CleanCSS({ sourceMap: true }).minify('a{background:url(image.png) 0 0 / 100% no-repeat}'); + }, + 'gets right output': function (minified) { + assert.equal(minified.styles, 'a{background:url(image.png) 0 0/100% no-repeat}'); + } + }, 'important': { 'topic': function () { return new CleanCSS({ sourceMap: true }).minify('@font-face{font-family:si}a{font-family:si!important}');