Fixes #247 - gets rid of deprecated selectorsMergeMode option.
authorJakub Pawlowicz <jakub@goalsmashers.com>
Tue, 25 Feb 2014 21:24:05 +0000 (21:24 +0000)
committerJakub Pawlowicz <jakub@goalsmashers.com>
Tue, 25 Feb 2014 21:25:36 +0000 (21:25 +0000)
History.md
README.md
bin/cleancss
lib/clean.js
lib/selectors/optimizer.js

index fcb03bd..c33e00b 100644 (file)
@@ -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)
 ==================
index 59312b5..a8b0737 100644 (file)
--- a/README.md
+++ b/README.md
@@ -71,7 +71,6 @@ cleancss [options] <source-file>
 --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)
 
index a093926..cf10025 100755 (executable)
@@ -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)
index 3f53203..ed00f51 100644 (file)
@@ -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();
     });
index ce50cc5..09318fa 100644 (file)
@@ -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) {