From: Jakub Pawlowicz Date: Sun, 8 Jun 2014 14:07:25 +0000 (+0100) Subject: Fixes list-style-* advanced processing. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=831a1fee1b28838640effdb0536d05eff8ba2aa8;p=clean-css.git Fixes list-style-* advanced processing. --- diff --git a/History.md b/History.md index 200be597..4d4b90da 100644 --- a/History.md +++ b/History.md @@ -7,6 +7,7 @@ * Adds `--rounding-precision` to control rounding precision. * Moves quotation matching into a `QuoteScanner` class. * Adds `npm run browserify` for creating embeddable version of clean-css. +* Fixed list-style-* advanced processing. * Fixed issue [#134](https://github.com/GoalSmashers/clean-css/issues/134) - merges properties into shorthand form. * Fixed issue [#164](https://github.com/GoalSmashers/clean-css/issues/164) - removes default values if not needed. * Fixed issue [#168](https://github.com/GoalSmashers/clean-css/issues/168) - adds better property merging algorithm. diff --git a/lib/properties/optimizer.js b/lib/properties/optimizer.js index aea10b5b..fe7903e9 100644 --- a/lib/properties/optimizer.js +++ b/lib/properties/optimizer.js @@ -69,9 +69,9 @@ module.exports = function Optimizer(compatibility, aggressiveMerging) { 'font-style': ['font'], 'font-variant': ['font'], 'font-weight': ['font'], - 'list-style-image': ['list'], - 'list-style-position': ['list'], - 'list-style-type': ['list'], + 'list-style-image': ['list-style'], + 'list-style-position': ['list-style'], + 'list-style-type': ['list-style'], 'margin-bottom': ['margin'], 'margin-left': ['margin'], 'margin-right': ['margin'], diff --git a/test/unit-test.js b/test/unit-test.js index 83f833fa..873668d0 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -59,13 +59,14 @@ var redefineContext = function(redefinitions, options) { for (var j = 0, m = prefixes.length; j < m; j++) { var prefixedProperty = prefixes[j] + property; var prefixedBy = prefixes[j] + by; + var zeroValue = options.noneFor.indexOf(prefixedProperty) > -1 ? 'none' : '0'; context['should override ' + prefixedProperty + ' by ' + prefixedBy] = [ - 'a{' + prefixedProperty + ':inherit;' + prefixedBy + ':0}', - 'a{' + prefixedBy + ':0}' + 'a{' + prefixedProperty + ':inherit;' + prefixedBy + ':' + zeroValue + '}', + 'a{' + prefixedBy + ':' + zeroValue + '}' ]; context['should not override ' + prefixedBy + ' by ' + prefixedProperty] = - 'a{' + prefixedBy + ':0;' + prefixedProperty + ':inherit}'; + 'a{' + prefixedBy + ':' + zeroValue + ';' + prefixedProperty + ':inherit}'; } } } @@ -1633,9 +1634,9 @@ title']{display:block}", 'font-style': ['font'], 'font-variant': ['font'], 'font-weight': ['font'], - 'list-style-image': ['list'], - 'list-style-position': ['list'], - 'list-style-type': ['list'], + 'list-style-image': ['list-style'], + 'list-style-position': ['list-style'], + 'list-style-type': ['list-style'], 'margin-bottom': ['margin'], 'margin-left': ['margin'], 'margin-right': ['margin'], @@ -1651,7 +1652,7 @@ title']{display:block}", 'transition-duration': ['transition'], 'transition-property': ['transition'], 'transition-timing-function': ['transition'] - }, { vendorPrefixes: ['animation', 'transition'] }), + }, { vendorPrefixes: ['animation', 'transition'], noneFor: ['list-style-image'] }), 'redefined more granular properties with property merging': cssContext({ 'should merge background with background-attachment': [ 'a{background:0;background-attachment:fixed}',