From: Jakub Pawlowicz Date: Tue, 25 Feb 2014 21:24:05 +0000 (+0000) Subject: Fixes #247 - gets rid of deprecated selectorsMergeMode option. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4221da1ba55b5fd4ded023e98e5fb133177be97a;p=clean-css.git Fixes #247 - gets rid of deprecated selectorsMergeMode option. --- diff --git a/History.md b/History.md index fcb03bdf..c33e00bf 100644 --- a/History.md +++ b/History.md @@ -2,6 +2,7 @@ ================== * Adds a better non-adjacent optimizer compatible with the upcoming new property optimizer. +* Fixed issue [#247](https://github.com/GoalSmashers/clean-css/issues/247) - removes deprecated `selectorsMergeMode` switch. [2.1.2 / 2014-02-25](https://github.com/GoalSmashers/clean-css/compare/v2.1.1...v2.1.2) ================== diff --git a/README.md b/README.md index 59312b51..a8b0737e 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,6 @@ cleancss [options] --skip-rebase Disable URLs rebasing --skip-advanced Disable advanced optimizations - selector & property merging, reduction, etc. ---selectors-merge-mode [ie8|*] DEPRECATED: Use --compatibility switch -c, --compatibility [ie7|ie8] Force compatibility mode -d, --debug Shows debug information (minification time & compression efficiency) ``` @@ -129,7 +128,6 @@ CleanCSS constructor accepts a hash as a parameter, i.e., * `processImport` - whether to process `@import` rules * `noRebase` - whether to skip URLs rebasing * `noAdvanced` - set to true to disable advanced optimizations - selector & property merging, reduction, etc. -* `selectorsMergeMode` - DEPRECATED: Use compatibility option * `compatibility` - Force compatibility mode to `ie7` or `ie8`. Defaults to not set. * `debug` - set to true to get minification statistics under `stats` property (see `test/custom-test.js` for examples) diff --git a/bin/cleancss b/bin/cleancss index a093926e..cf10025d 100755 --- a/bin/cleancss +++ b/bin/cleancss @@ -26,7 +26,6 @@ commands .option('-s, --skip-import', 'Disable @import processing') .option('--skip-rebase', 'Disable URLs rebasing') .option('--skip-advanced', 'Disable advanced optimizations - selector & property merging, reduction, etc.') - .option('--selectors-merge-mode [ie8|*]', 'DEPRECATED: Use --compatibility switch') .option('-c, --compatibility [ie7|ie8]', 'Force compatibility mode') .option('-t, --timeout [seconds]', 'Per connection timeout when fetching remote @imports (defaults to 5 seconds)') .option('-d, --debug', 'Shows debug information (minification time & compression efficiency)'); @@ -79,10 +78,6 @@ if (commands.skipAdvanced) cleanOptions.noAdvanced = true; if (commands.compatibility) cleanOptions.compatibility = commands.compatibility; -if (commands.selectorsMergeMode) { - console.warn('--selectors-merge-mode is deprecated and will be removed in clean-css 2.2. Please use --compatibility %s switch instead.', commands.selectorsMergeMode); - cleanOptions.compatibility = commands.selectorsMergeMode; -} if (commands.debug) cleanOptions.debug = true; if (commands.timeout) diff --git a/lib/clean.js b/lib/clean.js index 3f53203e..ed00f51a 100644 --- a/lib/clean.js +++ b/lib/clean.js @@ -37,11 +37,6 @@ var CleanCSS = module.exports = function CleanCSS(options) { if (undefined === options.processImport) options.processImport = true; - if (options.selectorsMergeMode) { - console.warn('selectorsMergeMode is deprecated and will be removed in clean-css 2.2. Please use compatibility: \'%s\' option instead.', options.selectorsMergeMode); - options.compatibility = options.selectorsMergeMode; - } - this.options = options; this.stats = {}; this.context = { @@ -336,13 +331,9 @@ var minify = function(data, callback) { replace(/\}/g, '}' + lineBreak); } else { replace(function optimizeSelectors() { - var mergeMode = ['ie7', 'ie8'].indexOf(options.compatibility) > -1 ? - options.compatibility : - '*'; data = new SelectorsOptimizer(data, context, { keepBreaks: options.keepBreaks, lineBreak: lineBreak, - selectorsMergeMode: mergeMode, compatibility: options.compatibility }).process(); }); diff --git a/lib/selectors/optimizer.js b/lib/selectors/optimizer.js index ce50cc56..09318fa2 100644 --- a/lib/selectors/optimizer.js +++ b/lib/selectors/optimizer.js @@ -59,7 +59,7 @@ module.exports = function Optimizer(data, context, options) { }; var isSpecial = function(selector) { - return specialSelectors[options.selectorsMergeMode || '*'].test(selector); + return specialSelectors[options.compatibility || '*'].test(selector); }; var removeDuplicates = function(tokens) {